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

0.4.2: pytest warnings #26

Closed
kloczek opened this issue Aug 5, 2023 · 8 comments
Closed

0.4.2: pytest warnings #26

kloczek opened this issue Aug 5, 2023 · 8 comments

Comments

@kloczek
Copy link

kloczek commented Aug 5, 2023

First of all pytest is not able to find test units because it scans by default tests_*.py files

+ /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/seedir-0.4.2
collected 0 items

=================================================================================== no tests ran in 0.02s ===================================================================================

However ..

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-seedir-0.4.2-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-seedir-0.4.2-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network' tests/tests.py
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.8.17, pytest-7.4.0, pluggy-1.2.0
rootdir: /home/tkloczko/rpmbuild/BUILD/seedir-0.4.2
collected 44 items

tests/tests.py ............................................                                                                                                                           [100%]

===================================================================================== warnings summary ======================================================================================
tests/tests.py:2
  /home/tkloczko/rpmbuild/BUILD/seedir-0.4.2/tests/tests.py:2: DeprecationWarning: invalid escape sequence \
    """

tests/tests.py:287
  /home/tkloczko/rpmbuild/BUILD/seedir-0.4.2/tests/tests.py:287: DeprecationWarning: invalid escape sequence \.
    y = x.seedir(printout=False, exclude_files='.*\..*', regex=True)

tests/tests.py:434
  /home/tkloczko/rpmbuild/BUILD/seedir-0.4.2/tests/tests.py:434: DeprecationWarning: invalid escape sequence \.
    exclude_files='.*\.txt',

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================================================================== 44 passed, 3 warnings in 0.59s ===============================================================================
@earnestt1234
Copy link
Owner

Thanks for the testing. Two things:

  • The testing was written for the builtin unittests, rather than pytest. There is an open issue (Make use of pytest for testing and use GitHub Actions #17) for explicitly creating pytest versions but that is TODO.
  • As for the warnings, I have not seen them before. Would you be able to share the Python version you are using?

@kloczek
Copy link
Author

kloczek commented Aug 7, 2023

Correctly written unittests test suite can be correctly handled by pytest.

@earnestt1234
Copy link
Owner

earnestt1234 commented Aug 7, 2023

Yes, I am aware of that.

The warnings stem from the backlashes in the module documentation header and two instances of backlashes in a regex pattern. I don't seeing this with the builtin tests, not sure why, but I do with pytest.
If you would like to create a pull request to fix this (and make things work with pytest as expected), I would be happy to approve. Otherwise I will do this when I am next available to work on seedir

@kloczek
Copy link
Author

kloczek commented Aug 9, 2023

Sorry but I have to much other work to do with packaging that I have not to much time for that king developmental.
Many later ..

@earnestt1234
Copy link
Owner

Fair enough! Thanks for reporting the issue, I will plan to fix unless anyone else claims

@kloczek
Copy link
Author

kloczek commented Aug 10, 2023

Thx 👍

@earnestt1234
Copy link
Owner

Tests are now compatible with pytest. See #17 for more information.

@kloczek
Copy link
Author

kloczek commented Jun 25, 2024

Thank you 👍

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

2 participants