Skip to content

Commit

Permalink
Allow colon to be used in test id
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Jan 10, 2024
1 parent 6ff466a commit 0b75c64
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pytest_plus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def get_max_test_id_length() -> int:
def get_test_id_regex() -> None | re.Pattern[str]:
"""Return regex to use for checking test ids."""
if int(os.environ.get("PYTEST_CHECK_TEST_ID_REGEX", "1")):
return re.compile(r"^[\w_\-\.]+$")
return re.compile(r"^[\w_\-\.:]+$")
return None


Expand Down
2 changes: 1 addition & 1 deletion test/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def test_a(some: str):
result = pytester.runpytest_inprocess("--collect-only", p1)
if not disable:
assert (
"Test <Function test_a[invalid name]> has an id that does not match our safe pattern '^[\\w_\\-\\.]+$' for use with a terminal."
"Test <Function test_a[invalid name]> has an id that does not match our safe pattern '^[\\w_\\-\\.:]+$' for use with a terminal."
in result.stderr.lines
)
assert result.ret == rc
Expand Down

0 comments on commit 0b75c64

Please sign in to comment.