test_that_experiment_with_a_scheduler_warning_event_shows_a_warning_dialog[scheduler_warning_event_between_snapshot_events]>
@pytest.hookimpl(wrapper=True, trylast=True)
def pytest_runtest_teardown(item):
"""
Hook called after each test tear down, to process any pending events and
avoiding leaking events to the next test. Also, if exceptions have
been captured during fixtures teardown, fail the test.
"""
_process_events()
_close_widgets(item)
_process_events()
> result = yield
^^^^^
/home/runner/work/ert/ert/.venv/lib/python3.11/site-packages/pytestqt/plugin.py:205:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
@pytest.fixture(autouse=True)
def env_save():
exceptions = [
"PYTEST_CURRENT_TEST",
"KMP_DUPLICATE_LIB_OK",
"KMP_INIT_AT_FORK",
"QT_API",
"COV_CORE_CONTEXT",
]
environment_pre = [
(key, val) for key, val in os.environ.items() if key not in exceptions
]
yield
environment_post = [
(key, val) for key, val in os.environ.items() if key not in exceptions
]
set_xor = set(environment_pre).symmetric_difference(set(environment_post))
> assert len(set_xor) == 0, f"Detected differences in environment: {set_xor}"
E AssertionError: Detected differences in environment: {('_ERT_EXPERIMENT_ID', 'c07ae22e-f317-4281-8703-9d00b9d1ec9e'), ('_ERT_ENSEMBLE_ID', '03c3a4c2-d51a-4b94-8758-87feb989b490')}
I've seen this test fail on PRs:
https://github.com/equinor/ert/actions/runs/25323198550/job/74237477180?pr=13416