Skip to content

Commit e7a77f6

Browse files
jacobschaerflub
authored andcommitted
Add unit test
Unit test for marker override of func_only
1 parent d68013a commit e7a77f6

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test_pytest_timeout.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,30 @@ def test_ini_timeout_func_only(testdir):
355355
@pytest.fixture
356356
def slow():
357357
time.sleep(2)
358+
def test_foo(slow):
359+
pass
360+
"""
361+
)
362+
testdir.makeini(
363+
"""
364+
[pytest]
365+
timeout = 1
366+
timeout_func_only = true
367+
"""
368+
)
369+
result = testdir.runpytest()
370+
assert result.ret == 0
371+
372+
373+
def test_ini_timeout_func_only_marker_override(testdir):
374+
testdir.makepyfile(
375+
"""
376+
import time, pytest
358377
378+
@pytest.fixture
379+
def slow():
380+
time.sleep(2)
381+
@pytest.mark.timeout(1.5)
359382
def test_foo(slow):
360383
pass
361384
"""

0 commit comments

Comments
 (0)