Closed kloczek closed 1 year ago
The way to run tests is by running tox
, e.g. tox -e py311
. Or if you want to do it directly, python -m unittest discover -v crochet.tests
.
I will however take a look since this suggests fragile tests.
I found and fixed the issue, but in general I don't recommend just using pytest
for any random project; it does Magic™ that occasionally breaks things, as in this case. And I still recommend you use the above command to run Crochet's tests.
I found and fixed the issue, but in general I don't recommend just using
pytest
for any random project; it does Magic™ that occasionally breaks things, as in this case. And I still recommend you use the above command to run Crochet's tests.
I'm building packages with python modules in dedicated build envs in which are installed only resources listed in rpm spec file BuildRequirea. In that scenario use tox is kind of double wrapping tox additionally if something is missing downloads .whl archives from pypi (I'm not interested to test anything against pypi but against my own packaged modules.
Just tested new 2.1.1 and all looks good now
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-crochet-2.1.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-crochet-2.1.1-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network'
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.8.17, pytest-7.4.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/crochet-2.1.1
plugins: mock-3.11.1, anyio-3.6.2, asyncio-0.21.0, aiohttp-1.0.4, httpbin-2.0.0
asyncio: mode=strict
collected 113 items
crochet/tests/test_api.py ................s.............................................. [ 55%]
crochet/tests/test_logging.py .... [ 59%]
crochet/tests/test_mypy.py .............. [ 71%]
crochet/tests/test_process.py . [ 72%]
crochet/tests/test_resultstore.py ..... [ 76%]
crochet/tests/test_setup.py ............s...s [ 92%]
crochet/tests/test_shutdown.py ..... [ 96%]
crochet/tests/test_util.py .... [100%]
================================================================================== short test summary info ==================================================================================
SKIPPED [1] crochet/tests/test_api.py:497: This test is too fragile (and insufficient) on Python 3 - see https://github.com/itamarst/crochet/issues/43
SKIPPED [1] crochet/tests/test_setup.py:267: This test is for non-POSIX systems.
SKIPPED [1] crochet/tests/test_setup.py:329: This test is for Twisted < 15.2.
========================================================================= 110 passed, 3 skipped in 67.77s (0:01:07) =========================================================================
Thank you 👍 😄
I'm packaging 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 --no-isolation
build
with--no-isolation
I'm using during all processes only locally installed modulescut off from access to the public network
(pytest is executed with-m "not network"
)Here is pytest output:
Here is list of installed modules in build env