@@ -55,9 +55,15 @@ def test_a():
55
55
def test_b():
56
56
assert False
57
57
58
- @pytest.mark.dependency(depends=["test_a"], scope='module' )
58
+ @pytest.mark.dependency(depends=["test_a"])
59
59
def test_c():
60
60
pass
61
+
62
+ class TestClass(object):
63
+
64
+ @pytest.mark.dependency()
65
+ def test_b(self):
66
+ pass
61
67
""" , test_scope_session_02 = """
62
68
import pytest
63
69
@@ -86,17 +92,26 @@ def test_f():
86
92
)
87
93
def test_g():
88
94
pass
95
+
96
+ @pytest.mark.dependency(
97
+ depends=["test_scope_session_01.py::TestClass::test_b"],
98
+ scope='session'
99
+ )
100
+ def test_h():
101
+ pass
89
102
""" )
90
103
result = ctestdir .runpytest ("--verbose" )
91
- result .assert_outcomes (passed = 4 , skipped = 1 , failed = 2 )
104
+ result .assert_outcomes (passed = 6 , skipped = 1 , failed = 2 )
92
105
result .stdout .fnmatch_lines ("""
93
106
test_scope_session_01.py::test_a PASSED
94
107
test_scope_session_01.py::test_b FAILED
95
108
test_scope_session_01.py::test_c PASSED
109
+ test_scope_session_01.py::TestClass::test_b PASSED
96
110
test_scope_session_02.py::test_a FAILED
97
111
test_scope_session_02.py::test_e PASSED
98
112
test_scope_session_02.py::test_f SKIPPED
99
113
test_scope_session_02.py::test_g PASSED
114
+ test_scope_session_02.py::test_h PASSED
100
115
""" )
101
116
102
117
@pytest .mark .xfail (reason = "package scope not yet implemented" )
0 commit comments