Repository navigation
Closed
Description
Yep .. 😄
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-utils-3.1.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-utils-3.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra python_utils
=========================================================================== 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-3.1.0, configfile: pytest.ini
plugins: hypothesis-6.35.0, cov-3.0.0, flake8-1.0.7, mypy-0.8.1
collected 31 items
python_utils/__init__.py .. [ 6%]
python_utils/__about__.py . [ 9%]
python_utils/aio.py . [ 12%]
python_utils/compat.py . [ 16%]
python_utils/containers.py ... [ 25%]
python_utils/converters.py ....... [ 48%]
python_utils/decorators.py ... [ 58%]
python_utils/formatters.py ... [ 67%]
python_utils/import_.py . [ 70%]
python_utils/logger.py .. [ 77%]
python_utils/terminal.py . [ 80%]
python_utils/time.py ..... [ 96%]
python_utils/types.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 28 0 0 0 100%
python_utils/aio.py 6 3 2 0 62% 7-9
python_utils/compat.py 0 0 0 0 100%
python_utils/containers.py 55 0 28 0 100%
python_utils/converters.py 82 0 44 0 100%
python_utils/decorators.py 18 0 4 0 100%
python_utils/formatters.py 30 0 20 0 100%
python_utils/import_.py 34 30 22 0 11% 31-85
python_utils/logger.py 36 0 4 0 100%
python_utils/terminal.py 3 0 0 0 100%
python_utils/time.py 74 17 32 2 78% 175, 200-222, 253
python_utils/types.py 13 0 0 0 100%
------------------------------------------------------------------------
TOTAL 385 50 156 2 86%
Coverage HTML written to dir htmlcov
FAIL Required test coverage of 100.0% not reached. Total coverage: 85.95%
=================================================================================== mypy ===================================================================================
Success: no issues found in 13 source files
=========================================================================== 31 passed in 16.24s ============================================================================
Metadata
Metadata
Assignees
Labels
No labels
Activity
wolph commentedon Jan 15, 2022
I don't see how or why... that code and those tests haven't even been touched the past 6 months.
And the automated tests are working without issue: https://github.com/WoLpH/python-utils/runs/4819234204?check_suite_focus=true
wolph commentedon Jan 15, 2022
Actually, looking at the output from the automated tests and your tests I can see at least 1 issue. It seems your tests are not running the tests in
_python_utils_tests:Github actions tests:
wolph commentedon Jan 15, 2022
The tests paths are configured in pytest.ini, do you have any idea why it's not reading that? https://github.com/WoLpH/python-utils/blob/c70f3b8b05686e84bc191995b7cce44b99f53c42/pytest.ini#L2-L4
kloczek commentedon Jan 15, 2022
I have no idea 🤔
Nevertheless when I'm running pytest without params pytest is scanning not only files specified in python_files (as same as in your case) and it shows as well some warnings.
pytestandcoverityused in my env are listed in pytest headr.Because pytest have been scanning setup.py Ive decided to add python_utils as pytest param.
Temporary in my rpm build procedure I'm using
--no-covwolph commentedon Jan 15, 2022
The setuptools warning and the asyncio warnings indicate missing requirements. These are part of the
testsextras in the requirements: https://github.com/WoLpH/python-utils/blob/c70f3b8b05686e84bc191995b7cce44b99f53c42/setup.py#L37-L46I think it should run fine once those are installed
kloczek commentedon Jan 15, 2022
pytest output after add
pytest-asyncioto build envSo looks OK now however still is one pytest warning.
kloczek commentedon Jan 15, 2022
Nevertheless after remove
--no-covstill coverity dost not show 100% 🤔wolph commentedon Jan 15, 2022
Did you see my previous message about installing the extra tests packages?
It looks like those might be missing.
kloczek commentedon Jan 15, 2022
Yes however I've lost somehow
pytest-asyncio(my fault).Looking one more time on that list I still don't have packaged
types-setuptools.Do you think that that eooe may be caused by missing that module? 🤔
kloczek commentedon May 4, 2022
Looks like latest pytest is failing
asyncio_modewarning can be fixed by addasyncio_mode=autoto pytest.iniwolph commentedon May 12, 2022
Thank you for letting me know :)
I've fixed all the issues and enabled nit-picky mode by default for the documentation tests
kloczek commentedon May 29, 2022
Just tested new version and generally test suite look better now.
Tis time I've tested as well pytest without specify
python_utilsas param.Looks like mypy complains about content of the setup.py
I'm not sure how to do that but IMO it would be good to make
flake8optional without emitting that warning.If you don't want to make it optional I would be glad to learn how to supress that exact warning because in my build procedure I don't need 'flake8` as obligatory rpm spec file BuildRequires.
kloczek commentedon May 29, 2022
Also I've manually tested pytest output with
pytest-blackinstalled and I think that it would be good to apply patch generated by that extensionDetails
completely removed pytest-flake8 remnanets to fix #29
wolph commentedon May 29, 2022
Thank you for letting me know @kloczek
That setting actually isn't needed anymore since the last migration to flake8 from pytest-flake8.
I've run
blackon the code as well but I'm not going to use the pytest-black plugin. I just moved away from pytest-flake8 because those kinds of plugins tend not to last (i've had to replace multiple over the years)