Skip to content

Commit 05b78d3

Browse files
committed
Add regex support to --xfails-file
1 parent dad7731 commit 05b78d3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

conftest.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import argparse
44
import warnings
55
import os
6+
import re
67

78
from hypothesis import settings
89
from hypothesis.errors import InvalidArgument
@@ -141,7 +142,10 @@ def check_id_match(id_, pattern):
141142
if id_.split("[", maxsplit=2)[0] == pattern:
142143
return True
143144

144-
return False
145+
try:
146+
return bool(re.match(pattern, id_))
147+
except re.error: # Not a regular expression
148+
return False
145149

146150

147151
def pytest_collection_modifyitems(config, items):

0 commit comments

Comments
 (0)