Open kloczek opened 1 year ago
- build is performed in env which is
cut off from access to the public network
(pytest is executed with-m "not network"
)
Then a number of the tests will simply fail. The test suite creates real DNS traffic.
- build is performed in env which is
cut off from access to the public network
(pytest is executed with-m "not network"
)Then a number of the tests will simply fail. The test suite creates real DNS traffic.
So it would be good to @pytest.mark.network
to those units which requires such access.
https://docs.pytest.org/en/7.1.x/example/markers.html
network
mark is already quite widely used in many other python modules test suites.
The test suite does not use pytest, it currently uses the vanilla unittest module.
I'd take a PR improving things here, but as it stands if you are interested in running the tests you need Internet access.
Correctly written unittest test suite can be handled by pytest.
Any units which needs public network should have @pytest.mark.network
https://docs.pytest.org/en/7.1.x/example/markers.html as that mark is currently widely used by many other python modules test suites.
PRs are welcome. I currently don't have the time or energy to see if pytest would just work and add decorate functions.
If you'd like to send a PR I'd be happy to review it.
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"
)Module si build with PYCARES_USE_SYSTEM_LIB=1. Here is pytest output:
Here is list of installed modules in build env