File tree 1 file changed +33
-0
lines changed
1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -487,3 +487,36 @@ def test_method(self):
487
487
result = django_testdir .runpytest_subprocess ("--pdb" )
488
488
result .stdout .fnmatch_lines (["*= 2 passed in *" ])
489
489
assert result .ret == 0
490
+
491
+
492
+ def test_cleaning_debug_post_teardown (django_testdir ):
493
+ p1 = django_testdir .create_test_module (
494
+ """
495
+ from unittest import SkipTest
496
+ from django.test import TestCase
497
+
498
+ post_teardown_count = 0
499
+
500
+
501
+ class TestClass1(TestCase):
502
+
503
+ def _post_teardown(self):
504
+ global post_teardown_count
505
+ post_teardown_count += 1
506
+
507
+ def test_1(self):
508
+ assert post_teardown_count == 0
509
+ raise SkipTest("skipped!")
510
+
511
+ def test_2(self):
512
+ assert post_teardown_count == 1
513
+ """
514
+ )
515
+
516
+ result = django_testdir .runpytest_subprocess (
517
+ "--pdb" ,
518
+ "{}::TestClass1::test_1" .format (p1 ),
519
+ "{}::TestClass1::test_2" .format (p1 ),
520
+ )
521
+ result .stdout .fnmatch_lines (["*= 1 passed, 1 skipped in *" ])
522
+ assert result .ret == 0
You can’t perform that action at this time.
0 commit comments