File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change
1
+ import re
1
2
import sys
2
3
import textwrap
3
4
12
13
13
14
timeout = 15
14
15
16
+ pytest_version = tuple (int (segment ) for segment in pytest .__version__ .split ("." )[:3 ])
17
+
15
18
16
19
# https://github.com/pytest-dev/pytest/issues/6505
17
20
def force_plural (name ):
@@ -1163,7 +1166,13 @@ def test_should_not_run():
1163
1166
# on Windows pytest isn't even reporting the status, just stopping...
1164
1167
assert_outcomes (rr , {})
1165
1168
rr .stdout .re_match_lines (lines2 = [r".* no tests ran in .*" ])
1166
- rr .stdout .no_re_match_line (pat = r".*test_should_not_run.*" )
1169
+
1170
+ pattern = r".*test_should_not_run.*"
1171
+
1172
+ if pytest_version >= (5 , 3 , 0 ):
1173
+ rr .stdout .no_re_match_line (pat = pattern )
1174
+ else :
1175
+ assert re .match (pattern , rr .stdout .str ()) is None
1167
1176
1168
1177
1169
1178
def test_sigint_for_inline_callbacks_tests (testdir , cmd_opts ):
@@ -1196,4 +1205,10 @@ def test_should_not_run():
1196
1205
# on Windows pytest isn't even reporting the status, just stopping...
1197
1206
assert_outcomes (rr , {})
1198
1207
rr .stdout .re_match_lines (lines2 = [r".* no tests ran in .*" ])
1199
- rr .stdout .no_re_match_line (pat = r".*test_should_not_run.*" )
1208
+
1209
+ pattern = r".*test_should_not_run.*"
1210
+
1211
+ if pytest_version >= (5 , 3 , 0 ):
1212
+ rr .stdout .no_re_match_line (pat = pattern )
1213
+ else :
1214
+ assert re .match (pattern , rr .stdout .str ()) is None
You can’t perform that action at this time.
0 commit comments