Skip to content

Commit a7518be

Browse files
committed
TST: Ensure pytest assertion rewriting occurs in subprocesses
This means that: 1. assertion failures look a little better 2. assertions actually happen if optimization is enabled
1 parent 338781e commit a7518be

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/matplotlib/testing/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ def subprocess_run_helper(func, *args, timeout, extra_env=None):
139139
[
140140
sys.executable,
141141
"-c",
142+
f"import pytest;"
143+
f"pytest.register_assert_rewrite({module!r});"
142144
f"import importlib.util;"
143145
f"_spec = importlib.util.spec_from_file_location({module!r}, {file!r});"
144146
f"_module = importlib.util.module_from_spec(_spec);"

0 commit comments

Comments
 (0)