Created
February 19, 2013 14:00
-
-
Save maizy/4986152 to your computer and use it in GitHub Desktop.
nosetests --with-isolations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# nosetests --with-isolation isolation.py | |
class T1(unittest.TestCase): | |
def a_test_set_global_val(self): | |
import math | |
math.abbb = 12 | |
self.assertTrue(math.abbb == 12) | |
def b_test_get_global_val_in_same_testcase(self): | |
import math | |
self.assertFalse(hasattr(math, 'abbb')) # fails, AssertionError :( | |
class T2(unittest.TestCase): | |
def a_test_get_global_val_in_other_testcase(self): | |
import math | |
self.assertFalse(hasattr(math, 'abbb')) # fails, AssertionError :( |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment