question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

warn when the cmdline_main hook raises systemexit

See original GitHub issue

While packaging scipy on PPC for conda-forge, I got caught out by the test suite failing at correction time, but erroneously reporting exit 0: https://github.com/conda-forge/scipy-feedstock/issues/186

+ python -c 'import scipy; scipy.test(verbose=2, label='\''full'\'', extra_argv=['\''--durations=50'\''])'
============================= test session starts ==============================
platform linux -- Python 3.9.6, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 -- $PREFIX/bin/python
cachedir: .pytest_cache
rootdir: $SRC_DIR
plugins: xdist-2.3.0, forked-1.3.0
collecting ... collected 46106 items / 1 error / 46105 selected

==================================== ERRORS ====================================
[snip]
=========================== short test summary info ============================
ERROR linalg/tests/test_sketches.py - ValueError: row index exceeds matrix di...
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
========================= 1 error in 713.78s (0:11:53) =========================
+ exit 0

Here’s the signature of scipy.test and how this maps into pytest.main.

This should be reproducible - probably only on PPC? - as follows (since the CI passed, the artefacts got published; not yet sure if we’ll recall them):

conda create -n test_env -c conda-forge python scipy
conda activate test_env
python -c "import scipy; scipy.test(verbose=2, label='full', extra_argv=['--durations=50'])"

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
RonnyPfannschmidtcommented, Aug 13, 2021

ok, pytests own cmdline mains dont raise systemexit, pytest shoud trigger a warning on bad plugins that raise systemexit in cmdline_main

0reactions
RonnyPfannschmidtcommented, Aug 13, 2021

uppon reviewing the code - it may be necessary to review where the systemexit is from, i’d like to enable pytest to return the error code there, as well (as far asi i can tell from the main function, it shouldnt error

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is there a way to prevent a SystemExit exception raised from ...
I have a situation in which I want to definitively and unquestionably exit from inside a test case, however the unittest module catches...
Read more >
Interrupted: 1 error during collection, SystemExit: 0 #9862
Interrupted: 1 error during collection, SystemExit: 0 #9862 ... Related: #8986 warn when the cmdline_main hook raises systemexit.
Read more >
Changelog — pytest documentation
HookRecorder. These constructors have always been considered private, but now issue a deprecation warning, which may become a hard error in pytest 8....
Read more >
2009-March.txt - Python mailing list
_path2confmods[path] except KeyError: + if path is None: + raise ... + config.pytestplugins.do_unconfigure(config) raise SystemExit(exitstatus) def ...
Read more >
pytest Documentation - Read the Docs - Yumpu
It will not raise SystemExit but return the exitcode. instead. You can pass in options and arguments: pytest.main(['-x', 'mytestdir']).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found