pyroute2
pyroute2 copied to clipboard
Unable to run pyroute2 unit test with setup.py
After building pyroute2-0.5.17 using python3 setup.py build
. I am trying to run unit tests using python3 setup.py test
. This throws error:
running test
running egg_info
writing pyroute2.egg-info/PKG-INFO
writing dependency_links to pyroute2.egg-info/dependency_links.txt
writing requirements to pyroute2.egg-info/requires.txt
writing top-level names to pyroute2.egg-info/top_level.txt
reading manifest file 'pyroute2.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'python-pyroute2.spec'
writing manifest file 'pyroute2.egg-info/SOURCES.txt'
running build_ext
Traceback (most recent call last):
File "setup.py", line 89, in
Are the tests run in some different way? What if we want to run using setup.py? python Version=> Python 3.7.5
— The test documentation is not updated yet — The CI is in transition from nose to pytest — The tests require:
- root access and they do change the system network stack (pure unit tests are not separate from functional yet)
- postgresql DB or an explicit env var to skip postgresql tests
The full setup may be like that (depending on distribution, on Fedora it's dnf
and a bit different package names:
# apt-get install postgresl-13 postgresql-server-dev-13 # or another version
# systemctl restart postgresql@13-main
# createdb pr2test
# make pytest # installs deps via pip -- see also tests/requirements.txt
Or:
# export SKIPDB=postgres
# make pytest # but psycopg2 is still required
So the nearest tasks are: * make postgres optional (but not by default) * make separate unit tests
But it is not as urgent since the complete functional testing is running now on travis for every PR as well.
Thank you for this ticket, I'll queue the task of ingration of unit tests with setup.py as well.
But wait:
# python setup.py test
running test
WARNING: Testing via this command is deprecated and will be removed in a future version.
Users looking for a generic test entry point independent of test runner are encouraged to use tox.
Now I'm not sure about the setuptools tests integration.
@prashant1221 would you consider tox integration instead?
But wait:
# python setup.py test running test WARNING: Testing via this command is deprecated and will be removed in a future version. Users looking for a generic test entry point independent of test runner are encouraged to use tox.
Now I'm not sure about the setuptools tests integration.
@prashant1221 would you consider tox integration instead?
Sure, tox would also be fine. Thanks for all the info.