()
| 6 | |
| 7 | @pytest.fixture(autouse=True) |
| 8 | def reset_options(): |
| 9 | options = [value for value in config.__dict__.values() if isinstance(value, Option)] |
| 10 | |
| 11 | should_unset = object() |
| 12 | original_values = [] |
| 13 | for opt in options: |
| 14 | original_values.append(opt.current if opt.is_set() else should_unset) |
| 15 | |
| 16 | yield |
| 17 | |
| 18 | for opt, val in zip(options, original_values): |
| 19 | if val is should_unset: |
| 20 | if opt.is_set(): |
| 21 | opt.unset() |
| 22 | else: |
| 23 | opt.current = val |
| 24 | |
| 25 | |
| 26 | def test_reactpy_debug_mode_toggle(): |