-
-
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
unittest runner: avoid tearDown and cleanup to ease post mortem debugging #1890
Changes from 3 commits
4eeb475
10b3274
be08223
696a911
e43d117
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 |
---|---|---|
|
@@ -18,15 +18,22 @@ | |
if a test suite uses ``pytest_plugins`` to load internal plugins (`#1888`_). | ||
Thanks `@jaraco`_ for the report and `@nicoddemus`_ for the PR (`#1891`_). | ||
|
||
* Do not call tearDown (and cleanups) when running unittest with ``--pdb`` | ||
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. I think we should make crystal clear that this change only affects unittest-tests, so I suggest replacing:
With:
|
||
enabled. This allows proper post mortem debugging for all applications | ||
which have significant logic in their tearDown method (`#1890`_). Thanks | ||
`@mbyt`_ for the PR. | ||
|
||
* | ||
|
||
.. _@joguSD: https://github.com/joguSD | ||
.. _@AiOO: https://github.com/AiOO | ||
.. _@mbyt: https://github.com/mbyt | ||
|
||
.. _#1857: https://github.com/pytest-dev/pytest/issues/1857 | ||
.. _#1864: https://github.com/pytest-dev/pytest/issues/1864 | ||
.. _#1888: https://github.com/pytest-dev/pytest/issues/1888 | ||
.. _#1891: https://github.com/pytest-dev/pytest/pull/1891 | ||
.. _#1890: https://github.com/pytest-dev/pytest/issues/1890 | ||
|
||
|
||
3.0.1 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -150,7 +150,12 @@ def stopTest(self, testcase): | |
pass | ||
|
||
def runtest(self): | ||
self._testcase(result=self) | ||
if self.config.pluginmanager.get_plugin("pdbinvoke") is None: | ||
self._testcase(result=self) | ||
else: | ||
# disables tearDown and cleanups for post mortem debugging | ||
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. Please add "(see #1890)" to this comment for future reference |
||
self._testcase.debug() | ||
|
||
|
||
def _prunetraceback(self, excinfo): | ||
pytest.Function._prunetraceback(self, excinfo) | ||
|
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.
Don't you want to use your real name here?
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.
Thanks for letting me know. If you do not mind, let's leave it like this.