diff options
| author | Konrad Delong <konryd@gmail.com> | 2010-07-27 14:53:37 +0200 |
|---|---|---|
| committer | Konrad Delong <konryd@gmail.com> | 2010-07-27 14:53:37 +0200 |
| commit | 0fdeba32a151981e522ad6bebdf5c8a1623082a7 (patch) | |
| tree | ed907340ede235ed5ba2402a44e50cdad2b6c047 /src/distutils2/command | |
| parent | 1f9c79453c4135240dd14260c936a562c261df13 (diff) | |
| download | disutils2-0fdeba32a151981e522ad6bebdf5c8a1623082a7.tar.gz | |
refactored test command tests and added another functional test
Diffstat (limited to 'src/distutils2/command')
| -rw-r--r-- | src/distutils2/command/test.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/distutils2/command/test.py b/src/distutils2/command/test.py index 31597bd..b2b985c 100644 --- a/src/distutils2/command/test.py +++ b/src/distutils2/command/test.py @@ -14,17 +14,16 @@ class test(Command): self.test_suite = None def finalize_options(self): - pass - - def distpath(self): - self.run_command('build') - build_cmd = self.get_finalized_command("build") - return os.path.join(build_cmd.build_base, "lib") + self.build_lib = self.get_finalized_command("build").build_lib def run(self): - orig_path = sys.path[:] + prev_cwd = os.getcwd() try: - sys.path.insert(0, self.distpath()) + if self.distribution.has_ext_modules(): + build = self.get_reinitialized_command('build') + build.inplace = 1 + self.run_command('build') + os.chdir(self.build_lib) unittest.main(module=self.test_suite, argv=sys.argv[:1]) finally: - sys.path[:] = orig_path + os.chdir(prev_cwd) |
