-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use session.config.hook instead of ihook. Fixes #2124 #2127
Changes from all commits
522d59e
a63b34c
14b6380
794d458
76f3be4
742f9cb
f320686
b671c5a
f0f2d2b
259b86b
258031a
6550b99
f074fd9
063335a
bdad345
6d3fe0b
a6f2d2d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -499,8 +499,16 @@ def __init__(self, fspath, parent=None, config=None, session=None): | |
super(FSCollector, self).__init__(name, parent, config, session) | ||
self.fspath = fspath | ||
|
||
def _check_initialpaths_for_relpath(self): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately I first merged with |
||
for initialpath in self.session._initialpaths: | ||
if self.fspath.common(initialpath) == initialpath: | ||
return self.fspath.relto(initialpath.dirname) | ||
|
||
def _makeid(self): | ||
relpath = self.fspath.relto(self.config.rootdir) | ||
|
||
if not relpath: | ||
relpath = self._check_initialpaths_for_relpath() | ||
if os.sep != nodes.SEP: | ||
relpath = relpath.replace(os.sep, nodes.SEP) | ||
return relpath | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
``pytest_fixture_setup`` and ``pytest_fixture_post_finalizer`` hooks are now called for all ``conftest.py`` files. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
``pytest_fixture_post_finalizer`` hook can now receive a ``request`` argument. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fix the bug where running pytest with "--pyargs" will result in Items with empty "parent.nodeid" if run from a different root directory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RonnyPfannschmidt I realized we should also do this at this point to avoid keeping instances of bound methods alive in case they are registered as finalizers and an exception occurred during teardown, do you agree?