Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.4.0: pytest is failing #24

Open
kloczek opened this issue Aug 11, 2023 · 0 comments
Open

1.4.0: pytest is failing #24

kloczek opened this issue Aug 11, 2023 · 0 comments

Comments

@kloczek
Copy link

kloczek commented Aug 11, 2023

I know that you are using as test suite unittest istead pytest however corroctly written unittest based test suite should be working with pytest as well.
On use pytest there are two issues:

  • pytest is not able find units because it scans by default tests_*py files only
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pylev-1.4.0-18.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pylev-1.4.0-18.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.2.0
rootdir: /home/tkloczko/rpmbuild/BUILD/pylev-1.4.0
collected 0 items

=================================================================================== no tests ran in 0.01s ===================================================================================
  • on pass as param tests.py pytest fails in one unit
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pylev-1.4.0-18.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pylev-1.4.0-18.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network' tests.py
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.8.17, pytest-7.4.0, pluggy-1.2.0
rootdir: /home/tkloczko/rpmbuild/BUILD/pylev-1.4.0
collected 23 items

tests.py ......................E                                                                                                                                                      [100%]

========================================================================================== ERRORS ===========================================================================================
_________________________________________________________________________________ ERROR at setup of test_fn _________________________________________________________________________________
file /home/tkloczko/rpmbuild/BUILD/pylev-1.4.0/tests.py, line 32
      def _test_fn(self):
E       fixture 'self' not found
>       available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
>       use 'pytest --fixtures [testpath]' for help on them.

/home/tkloczko/rpmbuild/BUILD/pylev-1.4.0/tests.py:32
================================================================================== short test summary info ==================================================================================
ERROR tests.py::test_fn
================================================================================ 22 passed, 1 error in 0.05s ================================================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant