From e5c81a9c73fcc0e97168937a3b0c6292b2c8b45f Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Sat, 27 Aug 2022 13:01:19 -0400 Subject: [PATCH] Replace deprecated `sre_constants.error` with `re.error` --- tests/config/unittest_config.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/config/unittest_config.py b/tests/config/unittest_config.py index 8c668aa529..a75de41bbb 100644 --- a/tests/config/unittest_config.py +++ b/tests/config/unittest_config.py @@ -7,7 +7,6 @@ from __future__ import annotations import re -import sre_constants import pytest @@ -24,7 +23,7 @@ def test__regexp_validator_valid() -> None: def test__regexp_validator_invalid() -> None: - with pytest.raises(sre_constants.error): + with pytest.raises(re.error): config.option._regexp_validator(None, None, "test_)") @@ -56,7 +55,7 @@ def test__regexp_csv_validator_valid() -> None: def test__regexp_csv_validator_invalid() -> None: pattern_strings = ["test_.*", "foo\\.bar", "^baz)$"] - with pytest.raises(sre_constants.error): + with pytest.raises(re.error): config.option._regexp_csv_validator(None, None, ",".join(pattern_strings))