Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.6.3: pytest is failing on coverage tests #28

Closed
kloczek opened this issue Dec 30, 2021 · 5 comments
Closed

2.6.3: pytest is failing on coverage tests #28

kloczek opened this issue Dec 30, 2021 · 5 comments

Comments

@kloczek
Copy link

kloczek commented Dec 30, 2021

I'm trying to package your module as an rpm package. So I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

  • python3 -sBm build -w
  • install .whl file in </install/prefix>
  • run pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>

Here is pytest output:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-utils-2.6.3-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-utils-2.6.3-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -p no:randomly
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/python-utils-2.6.3, configfile: pytest.ini
plugins: cov-3.0.0, flake8-1.0.7
collected 20 items

_python_utils_tests/test_import.py ......                                                                                                                            [ 30%]
_python_utils_tests/test_python_utils.py .                                                                                                                           [ 35%]
python_utils/converters.py ......                                                                                                                                    [ 65%]
python_utils/decorators.py .                                                                                                                                         [ 70%]
python_utils/formatters.py ..                                                                                                                                        [ 80%]
python_utils/logger.py .                                                                                                                                             [ 85%]
python_utils/time.py ...                                                                                                                                             [100%]

---------- coverage: platform linux, python 3.8.12-final-0 -----------
Name                         Stmts   Miss Branch BrPart  Cover   Missing
------------------------------------------------------------------------
python_utils/__about__.py        6      0      0      0   100%
python_utils/__init__.py         0      0      0      0   100%
python_utils/compat.py           0      0      0      0   100%
python_utils/converters.py      80      0     42      0   100%
python_utils/decorators.py       6      0      2      0   100%
python_utils/formatters.py      29      0     20      0   100%
python_utils/import_.py         32      0     22      0   100%
python_utils/logger.py          34      0      4      0   100%
python_utils/terminal.py         1      0      0      0   100%
python_utils/time.py            45      1     18      0    98%   167
------------------------------------------------------------------------
TOTAL                          233      1    108      0    99%
Coverage HTML written to dir htmlcov

FAIL Required test coverage of 100.0% not reached. Total coverage: 99.71%

============================================================================ 20 passed in 5.23s ============================================================================
@kloczek kloczek closed this as completed Dec 30, 2021
@kloczek kloczek reopened this Dec 30, 2021
@kloczek
Copy link
Author

kloczek commented Dec 30, 2021

Actually looks like it is new issue.

@wolph
Copy link
Owner

wolph commented Dec 31, 2021

Sorry about that... since Travis did the whole migration I haven't had my automated testing up to spec anymore and it seems that I forgot to wipe the coverage file after trying the tests on Python 2 (it fully succeeds on Python 2).

@wolph wolph closed this as completed in e2ed00a Dec 31, 2021
@kloczek
Copy link
Author

kloczek commented Dec 31, 2021

No problem :)
Tested and all is good now.

Thank you.

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-utils-2.6.3-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-utils-2.6.3-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -p no:randomly
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/python-utils-2.6.3, configfile: pytest.ini
plugins: cov-3.0.0, flake8-1.0.7
collected 20 items

_python_utils_tests/test_import.py ......                                                                                                                            [ 30%]
_python_utils_tests/test_python_utils.py .                                                                                                                           [ 35%]
python_utils/converters.py ......                                                                                                                                    [ 65%]
python_utils/decorators.py .                                                                                                                                         [ 70%]
python_utils/formatters.py ..                                                                                                                                        [ 80%]
python_utils/logger.py .                                                                                                                                             [ 85%]
python_utils/time.py ...                                                                                                                                             [100%]

---------- coverage: platform linux, python 3.8.12-final-0 -----------
Name                         Stmts   Miss Branch BrPart  Cover   Missing
------------------------------------------------------------------------
python_utils/__about__.py        6      0      0      0   100%
python_utils/__init__.py         0      0      0      0   100%
python_utils/compat.py           0      0      0      0   100%
python_utils/converters.py      80      0     42      0   100%
python_utils/decorators.py       6      0      2      0   100%
python_utils/formatters.py      29      0     20      0   100%
python_utils/import_.py         32      0     22      0   100%
python_utils/logger.py          34      0      4      0   100%
python_utils/terminal.py         1      0      0      0   100%
python_utils/time.py            44      0     18      0   100%
------------------------------------------------------------------------
TOTAL                          232      0    108      0   100%
Coverage HTML written to dir htmlcov

Required test coverage of 100.0% reached. Total coverage: 100.00%

============================================================================ 20 passed in 5.22s ============================================================================

@kloczek
Copy link
Author

kloczek commented Dec 31, 2021

.. and Happy New Year :)

@wolph
Copy link
Owner

wolph commented Dec 31, 2021

Happy new year to you as well. I'm just wondering, are the pytest issues in #21 and #20 fixed as well perhaps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants