File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,16 @@ Below is a complete list of all pytest features which are considered deprecated.
19
19
:class: `_pytest.warning_types.PytestWarning ` or subclasses, which can be filtered using
20
20
:ref: `standard warning filters <warnings >`.
21
21
22
+
23
+ Node Construction changed to ``Node.from_parent ``
24
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
25
+
26
+ .. deprecated :: 5.3
27
+
28
+ The construction of nodes new should use the named constructor ``from_parent ``.
29
+ This limitation in api surface intends to enable better/simpler refactoring of the collection tree.
30
+
31
+
22
32
``junit_family `` default value change to "xunit2"
23
33
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24
34
Original file line number Diff line number Diff line change 4
4
5
5
def pytest_collect_file (parent , path ):
6
6
if path .ext == ".yaml" and path .basename .startswith ("test" ):
7
- return YamlFile ( path , parent )
7
+ return YamlFile . from_parent ( parent , fspath = path )
8
8
9
9
10
10
class YamlFile (pytest .File ):
@@ -13,7 +13,7 @@ def collect(self):
13
13
14
14
raw = yaml .safe_load (self .fspath .open ())
15
15
for name , spec in sorted (raw .items ()):
16
- yield YamlItem ( name , self , spec )
16
+ yield YamlItem . from_parent ( self , name = name , spec = spec )
17
17
18
18
19
19
class YamlItem (pytest .Item ):
Original file line number Diff line number Diff line change @@ -13,4 +13,4 @@ def collect(self):
13
13
def pytest_pycollect_makemodule (path , parent ):
14
14
bn = path .basename
15
15
if "py3" in bn and not py3 or ("py2" in bn and py3 ):
16
- return DummyCollector ( path , parent = parent )
16
+ return DummyCollector . from_parent ( parent , fspath = path )
You can’t perform that action at this time.
0 commit comments