Use for pyqtgraph-specific test-functions.
(request, garbage_collect)
| 596 | |
| 597 | @pytest.fixture |
| 598 | def pg_backend(request, garbage_collect): |
| 599 | """Use for pyqtgraph-specific test-functions.""" |
| 600 | _check_pyqtgraph(request) |
| 601 | from mne_qt_browser._pg_figure import MNEQtBrowser |
| 602 | |
| 603 | with use_browser_backend("qt") as backend: |
| 604 | backend._close_all() |
| 605 | yield backend |
| 606 | backend._close_all() |
| 607 | # This shouldn't be necessary, but let's make sure nothing is stale |
| 608 | import mne_qt_browser |
| 609 | |
| 610 | mne_qt_browser._browser_instances.clear() |
| 611 | if not _test_passed(request): |
| 612 | return |
| 613 | _assert_no_instances(MNEQtBrowser, f"Closure of {request.node.name}") |
| 614 | |
| 615 | |
| 616 | @pytest.fixture( |
nothing calls this directly
no test coverage detected