Skip to content

Commit be9f031

Browse files
authored
Merge pull request #116 from gnikonorov/check_warnings_in_tests
Check for warnings output during unit tests
2 parents 7b8ab73 + fed6a0f commit be9f031

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

test_pytest_rerunfailures.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,9 @@ def test_fail():
245245
'--reruns-delay', str(delay_time))
246246

247247
if delay_time < 0:
248+
result.stdout.fnmatch_lines(
249+
'*UserWarning: Delay time between re-runs cannot be < 0. '
250+
'Using default value: 0')
248251
delay_time = 0
249252

250253
time.sleep.assert_called_with(delay_time)
@@ -266,6 +269,9 @@ def test_fail_two():
266269
result = testdir.runpytest()
267270

268271
if delay_time < 0:
272+
result.stdout.fnmatch_lines(
273+
'*UserWarning: Delay time between re-runs cannot be < 0. '
274+
'Using default value: 0')
269275
delay_time = 0
270276

271277
time.sleep.assert_called_with(delay_time)

0 commit comments

Comments
 (0)