diff --git a/tests/unit/test_call_run.py b/tests/unit/test_call_run.py index 30972c1a..88a72714 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,11 +36,10 @@ 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(): + warnings.simplefilter("error") run("", **kw) - assert not len(warn_rec) - class TestParseGlobalCfg: def test_path_correct(self):