File tree Expand file tree Collapse file tree 3 files changed +27
-0
lines changed Expand file tree Collapse file tree 3 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ Martin Prusse
91
91
Matt Bachmann
92
92
Matt Williams
93
93
Matthias Hafner
94
+ mbyt
94
95
Michael Aquilina
95
96
Michael Birtwell
96
97
Michael Droettboom
Original file line number Diff line number Diff line change 12
12
* Fix ``UnicodeEncodeError `` when string comparison with unicode has failed. (`#1864 `_)
13
13
Thanks `@AiOO `_ for the PR
14
14
15
+ * Do not call tearDown (and cleanups) when running unittest with ``--pdb ``
16
+ enabled. This allows proper post mortem debugging for all applications
17
+ which have significant logic in their tearDown method (`#1890 `_). Thanks
18
+ `@mbyt `_ for the PR.
19
+
15
20
*
16
21
17
22
.. _@joguSD : https://github.com/joguSD
18
23
.. _@AiOO : https://github.com/AiOO
24
+ .. _@mbyt : https://github.com/mbyt
19
25
20
26
.. _#1857 : https://github.com/pytest-dev/pytest/issues/1857
21
27
.. _#1864 : https://github.com/pytest-dev/pytest/issues/1864
28
+ .. _#1890 : https://github.com/pytest-dev/pytest/issues/1890
22
29
23
30
24
31
3.0.1
Original file line number Diff line number Diff line change @@ -79,6 +79,25 @@ def test_1():
79
79
if child .isalive ():
80
80
child .wait ()
81
81
82
+ def test_pdb_unittest_postmortem (self , testdir ):
83
+ p1 = testdir .makepyfile ("""
84
+ import unittest
85
+ class Blub(unittest.TestCase):
86
+ def tearDown(self):
87
+ self.filename = None
88
+ def test_false(self):
89
+ self.filename = 'bla' + '.txt'
90
+ assert 0
91
+ """ )
92
+ child = testdir .spawn_pytest ("--pdb %s" % p1 )
93
+ child .expect ('(Pdb)' )
94
+ child .sendline ('p self.filename' )
95
+ child .sendeof ()
96
+ rest = child .read ().decode ("utf8" )
97
+ assert 'bla.txt' in rest
98
+ if child .isalive ():
99
+ child .wait ()
100
+
82
101
def test_pdb_interaction_capture (self , testdir ):
83
102
p1 = testdir .makepyfile ("""
84
103
def test_1():
You can’t perform that action at this time.
0 commit comments