Skip to content

Commit b895816

Browse files
authored
Merge pull request #4092 from altendky/4073-altendky-subprocessing_timeout-take_2
Correct timing in test_pytester.test_testdir_run_with_timeout()
2 parents a6fb4c8 + 4071c8a commit b895816

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

testing/test_pytester.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,13 +412,15 @@ def test_testdir_run_no_timeout(testdir):
412412
def test_testdir_run_with_timeout(testdir):
413413
testfile = testdir.makepyfile("def test_no_timeout(): pass")
414414

415+
timeout = 120
416+
415417
start = time.time()
416-
result = testdir.runpytest_subprocess(testfile, timeout=120)
418+
result = testdir.runpytest_subprocess(testfile, timeout=timeout)
417419
end = time.time()
418420
duration = end - start
419421

420422
assert result.ret == EXIT_OK
421-
assert duration < 5
423+
assert duration < timeout
422424

423425

424426
def test_testdir_run_timeout_expires(testdir):

0 commit comments

Comments
 (0)