Blog Post #7

Utkarsh
Published: 08/01/2021

In this blog I cover the work done by me in the 7th week of GSOC. This week had me working on code coverage. The initial target set by my mentors for code coverage was 85%. The following lines explain what I was able to achieve, what problems I faced and what still needs to be done.

What did I do?

As already mentioned above, I worked on increasing the code coverage for the package this week. I worked on a total of 12 scripts this week. In some of the scripts I was able to increase the coverage more that 80%, but in a few I was not able to due to some internal server errors. Overall I achieved 81% coverage.
My work on individual scripts can be seen in the following links:

Also the coverage for individual files can be seen below:-

pytest --cov-config=.coveragerc --cov=pyafipws tests/                   
=========================== test session starts ===========================
platform win32 -- Python 3.9.6, pytest-6.2.3, py-1.10.0, pluggy-0.13.1
rootdir: C:\Users\shiva\OneDrive - Birla Institute of Technology\Desktop\GSoC_online\pyafipws, configfile: pytest.ini
plugins: cov-2.12.1, freezegun-0.4.2, html-3.1.1, metadata-1.11.0, vcr-1.0.2
collected 360 items

tests\test_pyfepdf.py ..............                                                                                                                                             [  3%]
tests\test_ws_sr_padron.py s.sx                                                                                                                                                  [  5%]
tests\test_wsaa.py ..............                                                                                                                                                [  8%]
tests\test_wsbfev1.py ...............                                                                                                                                            [ 13%]
tests\test_wscdc.py s...........                                                                                                                                                 [ 16%]
tests\test_wsct.py ..........xx..xxxxxxxxxxssxxxxxx..                                                                                                                            [ 25%]
tests\test_wsfev1.py ..........................                                                                                                                                  [ 33%]
tests\test_wsfev1_dummy.py .                                                                                                                                                     [ 33%]
tests\test_wsfexv1.py .................                                                                                                                                          [ 38%]
tests\test_wslsp.py ......................................x....................                                                                                                  [ 54%]
tests\test_wsltv.py ............................x.................                                                                                                               [ 67%]
tests\test_wslum.py ........................x...........                                                                                                                         [ 77%]
tests\test_wsmtx.py ..........................................                                                                                                                   [ 88%]
tests\test_wsremcarne.py ........................................                                                                                                                [100%]


----------- coverage: platform win32, python 3.9.6-final-0 -----------
Name                                                                          Stmts   Miss  Cover
-------------------------------------------------------------------------------------------------
py3\Lib\site-packages\PyAfipWs-3.9.b_2522_-py3.9.egg\pyafipws\__init__.py         4      0   100%
py3\Lib\site-packages\PyAfipWs-3.9.b_2522_-py3.9.egg\pyafipws\pyfepdf.py        802    162    80%
py3\Lib\site-packages\PyAfipWs-3.9.b_2522_-py3.9.egg\pyafipws\wsaa.py           350     81    77%
py3\Lib\site-packages\PyAfipWs-3.9.b_2522_-py3.9.egg\pyafipws\wsbfev1.py        382     53    86%
py3\Lib\site-packages\PyAfipWs-3.9.b_2522_-py3.9.egg\pyafipws\wscdc.py          213     32    85%
py3\Lib\site-packages\PyAfipWs-3.9.b_2522_-py3.9.egg\pyafipws\wsct.py           429    177    59%
py3\Lib\site-packages\PyAfipWs-3.9.b_2522_-py3.9.egg\pyafipws\wsfev1.py         684     83    88%
py3\Lib\site-packages\PyAfipWs-3.9.b_2522_-py3.9.egg\pyafipws\wsfexv1.py        454     73    84%
py3\Lib\site-packages\PyAfipWs-3.9.b_2522_-py3.9.egg\pyafipws\wslsp.py          622    103    83%
py3\Lib\site-packages\PyAfipWs-3.9.b_2522_-py3.9.egg\pyafipws\wsltv.py          561     84    85%
py3\Lib\site-packages\PyAfipWs-3.9.b_2522_-py3.9.egg\pyafipws\wslum.py          461    111    76%
py3\Lib\site-packages\PyAfipWs-3.9.b_2522_-py3.9.egg\pyafipws\wsmtx.py          607    119    80%
py3\Lib\site-packages\PyAfipWs-3.9.b_2522_-py3.9.egg\pyafipws\wsremcarne.py     432     66    85%
-------------------------------------------------------------------------------------------------
TOTAL                                                                          6001   1144    81%

======================= 333 passed, 5 skipped, 22 xfailed, 66 warnings in 57.58s =======================