MCPcopy Create free account
hub / github.com/numpy/numpy / check_fpu_mode

Function check_fpu_mode

numpy/conftest.py:95–112  ·  view source on GitHub ↗

Check FPU precision mode was not changed during the test.

(request)

Source from the content-addressed store, hash-verified

93
94@pytest.fixture(scope="function", autouse=True)
95def check_fpu_mode(request):
96 """
97 Check FPU precision mode was not changed during the test.
98 """
99 old_mode = get_fpu_mode()
100 yield
101 new_mode = get_fpu_mode()
102
103 if old_mode != new_mode:
104 raise AssertionError("FPU precision mode changed from {0:#x} to {1:#x}"
105 " during the test".format(old_mode, new_mode))
106
107 collect_result = _collect_results.get(request.node)
108 if collect_result is not None:
109 old_mode, new_mode = collect_result
110 raise AssertionError("FPU precision mode changed from {0:#x} to {1:#x}"
111 " when collecting the test".format(old_mode,
112 new_mode))
113
114
115@pytest.fixture(autouse=True)

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected