From 8bbdac7d065e408f3f320e4523274e10e1c469fc Mon Sep 17 00:00:00 2001 From: Philip Thiem Date: Sat, 7 Dec 2013 00:13:19 -0600 Subject: Modified setuptools.test.environment.ZipEnvironment to not choke on a bypassed setUp. test_egg_info, test_sdist, and test_svn all had tests that needed to be bypassed when svn was not present. tests.py26compat contains a SkipIf decorator for skipping. This worked after ironing a few wrinkles. The conditions is evaluated and stored in test_svn._svn_check. --- setuptools/tests/environment.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'setuptools/tests/environment.py') diff --git a/setuptools/tests/environment.py b/setuptools/tests/environment.py index bd2c53d2..476d280a 100644 --- a/setuptools/tests/environment.py +++ b/setuptools/tests/environment.py @@ -78,6 +78,9 @@ class ZippedEnvironment(unittest.TestCase): old_cwd = None def setUp(self): + if self.datafile is None or self.dataname is None: + return + if not os.path.isfile(self.datafile): self.old_cwd = None return @@ -98,6 +101,10 @@ class ZippedEnvironment(unittest.TestCase): os.chdir(os.path.join(self.temp_dir, self.dataname)) def tearDown(self): + #Assume setUp was never completed + if self.dataname is None or self.datafile is None: + return + try: if self.old_cwd: os.chdir(self.old_cwd) -- cgit v1.2.3