Skip to content

Commit

Permalink
Replace deprecated sre_constants.error with re.error
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtylerwalls authored and Pierre-Sassoulas committed Nov 17, 2022
1 parent ff159a6 commit e5c81a9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/config/unittest_config.py
Expand Up @@ -7,7 +7,6 @@
from __future__ import annotations

import re
import sre_constants

import pytest

Expand All @@ -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_)")


Expand Down Expand Up @@ -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))


Expand Down

0 comments on commit e5c81a9

Please sign in to comment.