summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2015-05-16 14:10:21 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2015-05-16 14:10:21 (GMT)
commit6738b1157a8153192369ff91798731ce29540c66 (patch)
tree234bcc1ed78bb1b84561898798f0ecf78d585d32
parentde12b79cd65ddde79fdaf794b58cd184f345a884 (diff)
downloadcpython-6738b1157a8153192369ff91798731ce29540c66.zip
cpython-6738b1157a8153192369ff91798731ce29540c66.tar.gz
cpython-6738b1157a8153192369ff91798731ce29540c66.tar.bz2
Issue 24208: Fix tests -- don't create a tempdir in __init__.
-rw-r--r--Lib/test/test_inspect.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py
index 3c27f55..bed3bad 100644
--- a/Lib/test/test_inspect.py
+++ b/Lib/test/test_inspect.py
@@ -288,9 +288,7 @@ class GetSourceBase(unittest.TestCase):
# Subclasses must override.
fodderModule = None
- def __init__(self, *args, **kwargs):
- unittest.TestCase.__init__(self, *args, **kwargs)
-
+ def setUp(self):
with open(inspect.getsourcefile(self.fodderModule)) as fp:
self.source = fp.read()
@@ -571,7 +569,7 @@ class TestBuggyCases(GetSourceBase):
self.assertSourceEqual(mod2.ClassWithMethod.method, 118, 119)
class TestNoEOL(GetSourceBase):
- def __init__(self, *args, **kwargs):
+ def setUp(self):
self.tempdir = TESTFN + '_dir'
os.mkdir(self.tempdir)
with open(os.path.join(self.tempdir,
@@ -580,7 +578,7 @@ class TestNoEOL(GetSourceBase):
with DirsOnSysPath(self.tempdir):
import inspect_fodder3 as mod3
self.fodderModule = mod3
- GetSourceBase.__init__(self, *args, **kwargs)
+ super().setUp()
def tearDown(self):
shutil.rmtree(self.tempdir)