File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ """Verify the messages issued when a dependent test is skipped.
2
+ """
3
+
4
+ import pytest
5
+
6
+
7
+ def test_simple (ctestdir ):
8
+ """One test fails, other dependent tests are skipped.
9
+ This also includes indirect dependencies.
10
+ """
11
+ ctestdir .makepyfile ("""
12
+ import pytest
13
+
14
+ @pytest.mark.dependency()
15
+ def test_a():
16
+ pass
17
+
18
+ @pytest.mark.dependency()
19
+ def test_b():
20
+ assert False
21
+
22
+ @pytest.mark.dependency(depends=["test_b"])
23
+ def test_c():
24
+ pass
25
+
26
+ @pytest.mark.dependency(depends=["test_c"])
27
+ def test_d():
28
+ pass
29
+ """ )
30
+ result = ctestdir .runpytest ("--verbose" , "-rs" )
31
+ result .assert_outcomes (passed = 1 , skipped = 2 , failed = 1 )
32
+ result .stdout .fnmatch_lines ("""
33
+ *::test_a PASSED
34
+ *::test_b FAILED
35
+ *::test_c SKIPPED
36
+ *::test_d SKIPPED
37
+ SKIP * test_c depends on test_b
38
+ SKIP * test_d depends on test_c
39
+ """ )
You can’t perform that action at this time.
0 commit comments