Skip to content

Commit b21b942

Browse files
committed
Send regexp in conf tests as raw strings
1 parent cffdb78 commit b21b942

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/config/tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ def test_config_all_upper_case():
460460

461461

462462
def test_regex_validator_without_match():
463-
validator = RegexValidator("\d")
463+
validator = RegexValidator(r"\d")
464464
with pytest.raises(ConfigurationError) as e:
465465
validator("foo", "field")
466466
assert "does not match pattern" in e.value.args[0]
@@ -474,7 +474,7 @@ def test_unit_validator_without_match():
474474

475475

476476
def test_unit_validator_with_unsupported_unit():
477-
validator = UnitValidator("(\d+)(s)", "secs", {})
477+
validator = UnitValidator(r"(\d+)(s)", "secs", {})
478478
with pytest.raises(ConfigurationError) as e:
479479
validator("10s", "field")
480480
assert "is not a supported unit" in e.value.args[0]

0 commit comments

Comments
 (0)