From dc407105d25869e8c506b2f15ce378ca44f0d31d Mon Sep 17 00:00:00 2001 From: Sean Mackesey Date: Sun, 3 Mar 2024 17:08:07 -0500 Subject: [PATCH] Fix test for compatibility with pytest 8.1 (#20225) ## Summary & Motivation Pytest 8.1 was just released and breaks one of our tests, this fixes it. ## How I Tested These Changes BK --- .../dagster_tests/definitions_tests/test_composition.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/python_modules/dagster/dagster_tests/definitions_tests/test_composition.py b/python_modules/dagster/dagster_tests/definitions_tests/test_composition.py index 45ff4631fc055..a20b0e8814087 100644 --- a/python_modules/dagster/dagster_tests/definitions_tests/test_composition.py +++ b/python_modules/dagster/dagster_tests/definitions_tests/test_composition.py @@ -527,7 +527,8 @@ def single_input_op(): def test_collision_invocations(): - with pytest.warns(None) as record: + with warnings.catch_warnings(): + warnings.simplefilter("error") @job def _(): @@ -535,8 +536,6 @@ def _(): single_input_op() single_input_op() - assert len(record) == 0 - def test_alias_invoked(recwarn): @job