diff --git a/tests/unit/test_call_run.py b/tests/unit/test_call_run.py index 30972c1a..db169536 100644 --- a/tests/unit/test_call_run.py +++ b/tests/unit/test_call_run.py @@ -1,3 +1,4 @@ +import warnings from unittest.mock import patch import pytest @@ -35,7 +36,7 @@ def test_run_with_cfg(self): ) def test_doesnt_warn_about_expected_kwargs(self, expected_kwarg): kw = {expected_kwarg: 123} - with pytest.warns(None) as warn_rec: + with warnings.catch_warnings(record=True) as warn_rec: run("", **kw) assert not len(warn_rec)