MCPcopy
hub / github.com/numpy/numpy / check_fpu_mode

Function check_fpu_mode

numpy/conftest.py:144–160  ·  view source on GitHub ↗

Check FPU precision mode was not changed during the test.

(request)

Source from the content-addressed store, hash-verified

142
143@pytest.fixture(scope="function", autouse=True)
144def check_fpu_mode(request):
145 """
146 Check FPU precision mode was not changed during the test.
147 """
148 old_mode = get_fpu_mode()
149 yield
150 new_mode = get_fpu_mode()
151
152 if old_mode != new_mode:
153 raise AssertionError(f"FPU precision mode changed from {old_mode:#x} to "
154 f"{new_mode:#x} during the test")
155
156 collect_result = _collect_results.get(request.node)
157 if collect_result is not None:
158 old_mode, new_mode = collect_result
159 raise AssertionError(f"FPU precision mode changed from {old_mode:#x} to "
160 f"{new_mode:#x} when collecting the test")
161
162
163@pytest.fixture(autouse=True)

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…