-
Notifications
You must be signed in to change notification settings - Fork 50
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
2021.11.10: pytest is failing #448
Comments
You didn't say how you got the source code, but judging from the "regex_3" it appears that you got it from the repository. The problem with that is that it contains sources for both Python 2 and Python 3. I've started from the contents of the source distribution and it works for me on Windows, which is what I use. |
Yes I've used git tagged tar ball. |
Just tested 2022.3.2 and looks like issie still is not ressolved. |
gentle ping 😋 |
Just retested 2022.8.17 and looks like issue still is around .. + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-regex-2022.8.17-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-regex-2022.8.17-2.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.3, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/mrab-regex-2022.8.17
collected 101 items
regex_3/test_regex.py ....................................................................................................F [100%]
================================================================================= FAILURES =================================================================================
________________________________________________________________________________ test_main _________________________________________________________________________________
def test_main():
> unittest.main(verbosity=2)
regex_3/test_regex.py:4448:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib64/python3.8/unittest/main.py:100: in __init__
self.parseArgs(argv)
/usr/lib64/python3.8/unittest/main.py:133: in parseArgs
self._main_parser.parse_args(argv[1:], self)
/usr/lib64/python3.8/argparse.py:1771: in parse_args
self.error(msg % ' '.join(argv))
/usr/lib64/python3.8/argparse.py:2521: in error
self.exit(2, _('%(prog)s: error: %(message)s\n') % args)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ArgumentParser(prog='pytest', usage=None, description=None, formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True), status = 2
message = 'pytest: error: unrecognized arguments: -ra\n'
def exit(self, status=0, message=None):
if message:
self._print_message(message, _sys.stderr)
> _sys.exit(status)
E SystemExit: 2
/usr/lib64/python3.8/argparse.py:2508: SystemExit
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
usage: pytest [-h] [-v] [-q] [--locals] [-f] [-c] [-b] [-k TESTNAMEPATTERNS]
[tests [tests ...]]
pytest: error: unrecognized arguments: -ra
========================================================================= short test summary info ==========================================================================
FAILED regex_3/test_regex.py::test_main - SystemExit: 2
====================================================================== 1 failed, 100 passed in 1.02s ======================================================================= |
Only FTR: just tested 2024.4.16 and Here is pytest output:+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-regex-2024.4.16-2.fc37.x86_64/usr/lib64/python3.10/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-regex-2024.4.16-2.fc37.x86_64/usr/lib/python3.10/site-packages
+ /usr/bin/pytest -ra -m 'not network'
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.10.14, pytest-8.1.1, pluggy-1.4.0
benchmark: 4.0.0 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /home/tkloczko/rpmbuild/BUILD/mrab-regex-2024.4.16
configfile: pyproject.toml
plugins: mock-3.14.0, benchmark-4.0.0, timeout-2.3.1
collected 102 items
regex_3/test_regex.py .....................................................................................................F [100%]
========================================================================================= FAILURES ==========================================================================================
_________________________________________________________________________________________ test_main _________________________________________________________________________________________
def test_main():
> unittest.main(verbosity=2)
regex_3/test_regex.py:4458:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib64/python3.10/unittest/main.py:100: in __init__
self.parseArgs(argv)
/usr/lib64/python3.10/unittest/main.py:133: in parseArgs
self._main_parser.parse_args(argv[1:], self)
/usr/lib64/python3.10/argparse.py:1836: in parse_args
self.error(msg % ' '.join(argv))
/usr/lib64/python3.10/argparse.py:2594: in error
self.exit(2, _('%(prog)s: error: %(message)s\n') % args)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = ArgumentParser(prog='pytest', usage=None, description=None, formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True), status = 2
message = 'pytest: error: unrecognized arguments: -ra -m\n'
def exit(self, status=0, message=None):
if message:
self._print_message(message, _sys.stderr)
> _sys.exit(status)
E SystemExit: 2
/usr/lib64/python3.10/argparse.py:2581: SystemExit
----------------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------------
usage: pytest [-h] [-v] [-q] [--locals] [-f] [-c] [-b] [-k TESTNAMEPATTERNS]
[tests ...]
pytest: error: unrecognized arguments: -ra -m
================================================================================== short test summary info ==================================================================================
FAILED regex_3/test_regex.py::test_main - SystemExit: 2
=============================================================================== 1 failed, 101 passed in 1.07s =============================================================================== |
The root issue here is the test invocation: try one of the following:
There is a function in the test module called |
I'm trying to package your module as an rpm package. So I'm using the typical build, install and test cycle used on building packages from non-root account.
Here is pytest output with one unit failing and some warnings as well:
The text was updated successfully, but these errors were encountered: