Check FPU precision mode was not changed during the test.
(request)
| 93 | |
| 94 | @pytest.fixture(scope="function", autouse=True) |
| 95 | def 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) |