Conversation
| PY3 = sys.version_info[0] == 3 | ||
| PY2 = sys.version_info[0] == 2 | ||
|
|
||
| PYTEST4 = pytest and pytest.__version__ >= '4.0.0' |
There was a problem hiding this comment.
This doesn't do the same as the PY2 and PY3 constants above. It also evaluates to True if the runner is nose or unittest but when pytest is importable.
Workaround: add detect_runner() == 'pytest' to any conditional using it.
| PY3 = sys.version_info[0] == 3 | ||
| PY2 = sys.version_info[0] == 2 | ||
|
|
||
| PYTEST4 = pytest and pytest.__version__ >= '4.0.0' |
There was a problem hiding this comment.
I would also note that e.g. '10.0.0' is lower than '4.0.0'. Something like this should work:
| PYTEST4 = pytest and pytest.__version__ >= '4.0.0' | |
| PYTEST4 = pytest and int(pytest.__version__.split('.')[0]) >= 4 |
|
I've been tryimg to test this PR and pytest was not able to find units + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-parameterized-0.8.1-3.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-parameterized-0.8.1-3.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/parameterized-0.8.1
collected 0 items
========================================================================== no tests ran in 0.01s =========================================================================== |
|
After add + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-parameterized-0.8.1-3.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-parameterized-0.8.1-3.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra --pyargs parameterized.test
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/parameterized-0.8.1
collected 0 items / 1 error
================================================================================== ERRORS ==================================================================================
______________________________________________________________________ ERROR collecting test session _______________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILDROOT/python-parameterized-0.8.1-3.fc35.x86_64/usr/lib/python3.8/site-packages/parameterized/test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
../../BUILDROOT/python-parameterized-0.8.1-3.fc35.x86_64/usr/lib/python3.8/site-packages/parameterized/test.py:6: in <module>
from nose.tools import assert_equal, assert_raises
E ModuleNotFoundError: No module named 'nose'
========================================================================= short test summary info ==========================================================================
ERROR
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================================= 1 error in 0.10s =============================================================================Test suite shoud be rewrited to use pytest as |
|
On migration to pytest usefull could be https://github.com/schollii/nose2pytest/ |
OK. Is it possible to update this PR? |
|
Possible? Probably yes |
OK so my understandimg is that to update this PR it needas to be submittdd PR against forked repo and if @wolever will accept that PR thos PR will be updated as well. |
|
Or submit another one. |
|
thanks @hroncok ! i've applied the Fedora's patch to the debian package and now tests are passing with pytest 7 |
|
I tried to rebase this on |
No description provided.