File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 1
1
import unittest
2
+ from test_unittest_isolated import global_context
2
3
3
4
4
5
class TestUnittestAssertions (unittest .TestCase ):
@@ -142,6 +143,11 @@ def testInner():
142
143
else :
143
144
self .fail ("Unexpected success was not detected" )
144
145
146
+ def test_NotChangedByOtherTest (self ):
147
+ global global_context
148
+ assert global_context is None
149
+ global_context = True
150
+
145
151
146
152
if __name__ == "__main__" :
147
153
unittest .main ()
Original file line number Diff line number Diff line change
1
+ import unittest
2
+
3
+
4
+ global_context = None
5
+
6
+
7
+ class TestUnittestIsolated (unittest .TestCase ):
8
+ def test_NotChangedByOtherTest (self ):
9
+ global global_context
10
+ assert global_context is None
11
+ global_context = True
12
+
13
+
14
+ if __name__ == "__main__" :
15
+ unittest .main ()
You can’t perform that action at this time.
0 commit comments