summaryrefslogtreecommitdiff
path: root/src/distutils2/command
diff options
context:
space:
mode:
authorKonrad Delong <konryd@gmail.com>2010-07-27 14:53:37 +0200
committerKonrad Delong <konryd@gmail.com>2010-07-27 14:53:37 +0200
commit0fdeba32a151981e522ad6bebdf5c8a1623082a7 (patch)
treeed907340ede235ed5ba2402a44e50cdad2b6c047 /src/distutils2/command
parent1f9c79453c4135240dd14260c936a562c261df13 (diff)
downloaddisutils2-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.py17
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)