Repository navigation
Node from parent - #5975
Node from parent#5975
Conversation
dd515e0 to
fe251f4
Compare
|
this is now in a shape where critical examination is needed and merge after history clean/detail fixes |
|
scrap that, i realized that i want to ensure the arguments are severely limited in order to prepare the switchover |
| @classmethod | ||
| def from_parent(cls, parent, **kw): | ||
| return cls._create(**kw, parent=parent) | ||
|
|
There was a problem hiding this comment.
What's the benefit compared to making parent a required argument in general? (would avoid a lot of changes at least)
There was a problem hiding this comment.
i need to establish a distinct construction pattern in order to then follow up with cleaning up the node construction (thats overly smart and auto-creating different things)
i tried a few times before without that and just failed flat on those occasions
There was a problem hiding this comment.
Ok.
But maybe then we could just revert it to "normal" object instantiation afterwards? (i.e. before merging, not requiring all the warnings etc).
I think raising TypeErrors and using type annotations in general could be enough?
There was a problem hiding this comment.
as soon as the ctor situation is largely resolved and the pattern is established, the meta class can go
1dd2483 to
20c2424
Compare
20c2424 to
5217483
Compare
nicoddemus
left a comment
There was a problem hiding this comment.
Overall this looks great!
Other than that, please also add an entry to deprecations.rst with a .. deprecated:: directive, and more importantly, a longer rationale of the reasons why this is being deprecated.
|
i believe im done with the technical part now, will take a look at doing docs over the weekend |
88a0e82 to
43b5c30
Compare
894b187 to
0a7b948
Compare
0a7b948 to
15ffe63
Compare
This reverts commit a3c8246, reversing changes made to 886b8d2. Ref: pytest-dev#5975 (comment) Conflicts: src/_pytest/main.py src/_pytest/unittest.py Squashed: 7c4b8a0 Revert "Node from parent (pytest-dev#5975)" 89abdb9 keep test, warning c9062ed warn via NodeMeta 149bddb keep/adjust testing/test_mark.py:1013::test_addmarker_order de91222 tests: handle DefinitionMock 9e3b17f fix testing/test_collection.py:453::TestSession::test_parsearg Conflicts: both modified: src/_pytest/nodes.py both modified: src/_pytest/python.py
The Node API was changed in pytest 5.4 in pytest-dev/pytest#5975. This commit adds support for the new API but maintains backwards compatiblity. Closes: #11
The Node API was changed in pytest 5.4 in pytest-dev/pytest#5975. This commit adds support for the new API but maintains backwards compatiblity. Closes: #11
The Node API was changed in pytest 5.4 in pytest-dev/pytest#5975. This commit adds support for the new API but maintains backwards compatiblity. Closes: #11
The Node API was changed in pytest 5.4 in pytest-dev/pytest#5975. This commit adds support for the new API but maintains backwards compatiblity. Closes: #11
Keeps `Node.from_parent` for backward compatibility. This reverts commit a3c8246, reversing changes made to 886b8d2. Ref: pytest-dev#5975 (comment)
Keeps `Node.from_parent` for backward compatibility. This reverts commit a3c8246, reversing changes made to 886b8d2. Ref: pytest-dev#5975 (comment)
Keeps `Node.from_parent` for backward compatibility. This reverts commit a3c8246, reversing changes made to 886b8d2. Ref: pytest-dev#5975 (comment)
Keeps `Node.from_parent` for backward compatibility. This reverts commit a3c8246, reversing changes made to 886b8d2. Ref: pytest-dev#5975 (comment)
Keeps `Node.from_parent` for backward compatibility. This reverts commit a3c8246, reversing changes made to 886b8d2. Ref: pytest-dev#5975 (comment)
Keeps `Node.from_parent` for backward compatibility. This reverts commit a3c8246, reversing changes made to 886b8d2. Ref: pytest-dev#5975 (comment)
this pr experiments with introducing a
Node.from_parentapi that is to replace the smart constructors eventuallyit will take a while manifest this experiment