Skip to content

Commit 1ff314d

Browse files
committed
TST: Validate the return code of test_full_reimport
All errors raised within the sub process will remain silenced if the return code isn't validated
1 parent ee98558 commit 1ff314d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

numpy/tests/test_reloading.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,8 @@ def test_full_reimport():
5757
with warns(UserWarning):
5858
import numpy as np
5959
""")
60-
p = subprocess.run([sys.executable, '-c', code])
61-
60+
p = subprocess.run([sys.executable, '-c', code], capture_output=True)
61+
if p.returncode:
62+
raise AssertionError(
63+
f"Non-zero return code: {p.returncode!r}\n\n{p.stderr.decode()}"
64+
)

0 commit comments

Comments
 (0)