diff options
author | Tarek Ziade <tarek@ziade.org> | 2010-05-06 18:10:32 +0200 |
---|---|---|
committer | Tarek Ziade <tarek@ziade.org> | 2010-05-06 18:10:32 +0200 |
commit | 6a6a261fa50522d77fba6d6345fb71ba9f00c311 (patch) | |
tree | 4d025291624e9ce33cfed1400b13907d8384d145 /setuptools/tests/test_sandbox.py | |
parent | 3cd5038930832fce95fb41d20150e173eb9894b5 (diff) | |
download | external_python_setuptools-6a6a261fa50522d77fba6d6345fb71ba9f00c311.tar.gz external_python_setuptools-6a6a261fa50522d77fba6d6345fb71ba9f00c311.tar.bz2 external_python_setuptools-6a6a261fa50522d77fba6d6345fb71ba9f00c311.zip |
make sure all tests passes on all python versions fixes #149
--HG--
branch : distribute
extra : rebase_source : 6288f4fcf65083b9d4ffb0ea8b35af44e699b4d5
Diffstat (limited to 'setuptools/tests/test_sandbox.py')
-rw-r--r-- | setuptools/tests/test_sandbox.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/setuptools/tests/test_sandbox.py b/setuptools/tests/test_sandbox.py index 8b9e08e6..1609ee86 100644 --- a/setuptools/tests/test_sandbox.py +++ b/setuptools/tests/test_sandbox.py @@ -30,10 +30,11 @@ class TestSandbox(unittest.TestCase): shutil.rmtree(self.dir) def test_devnull(self): + if sys.version < '2.4': + return sandbox = DirectorySandbox(self.dir) sandbox.run(self._file_writer(os.devnull)) - @staticmethod def _file_writer(path): def do_write(): f = open(path, 'w') @@ -41,6 +42,7 @@ class TestSandbox(unittest.TestCase): f.close() return do_write + _file_writer = staticmethod(_file_writer) if has_win32com(): def test_win32com(self): @@ -53,9 +55,10 @@ class TestSandbox(unittest.TestCase): target = os.path.join(gen_py, 'test_write') sandbox = DirectorySandbox(self.dir) try: - sandbox.run(self._file_writer(target)) - except SandboxViolation: - self.fail("Could not create gen_py file due to SandboxViolation") + try: + sandbox.run(self._file_writer(target)) + except SandboxViolation: + self.fail("Could not create gen_py file due to SandboxViolation") finally: if os.path.exists(target): os.remove(target) |