python-2.7.1-distutils_test_path
authorAnas Nashif <anas.nashif@intel.com>
Wed, 7 Nov 2012 15:29:36 +0000 (07:29 -0800)
committerChanho Park <chanho61.park@samsung.com>
Tue, 19 Aug 2014 10:37:01 +0000 (19:37 +0900)
===================================================================

Lib/distutils/tests/test_build_ext.py
Lib/test/regrtest.py

index d380cb6a3d46e15174668293e355768d83c9dbe3..08f5923c17245da5506e874a82b338e1d9eb5d83 100644 (file)
@@ -277,20 +277,14 @@ class BuildExtTestCase(support.TempdirManager,
 
         # issue #5977 : distutils build_ext.get_outputs
         # returns wrong result with --inplace
-        other_tmp_dir = os.path.realpath(self.mkdtemp())
-        old_wd = os.getcwd()
-        os.chdir(other_tmp_dir)
-        try:
-            cmd.inplace = 1
-            cmd.run()
-            so_file = cmd.get_outputs()[0]
-        finally:
-            os.chdir(old_wd)
+        cmd.inplace = 1
+        cmd.run()
+        so_file = cmd.get_outputs()[0]
         self.assertTrue(os.path.exists(so_file))
         self.assertEqual(os.path.splitext(so_file)[-1],
                          sysconfig.get_config_var('SO'))
         so_dir = os.path.dirname(so_file)
-        self.assertEqual(so_dir, other_tmp_dir)
+        self.assertEqual(so_dir, os.getcwd())
         cmd.compiler = None
         cmd.inplace = 0
         cmd.run()
index 21709f7032a135e1ebfd90ba72c51d6cfa695cf0..d5751d1a1ecf80d0b5c304f5bba7886c73d55b2d 100755 (executable)
@@ -1547,16 +1547,5 @@ if __name__ == '__main__':
         if not os.path.exists(TEMPDIR):
             os.mkdir(TEMPDIR)
 
-    # Define a writable temp dir that will be used as cwd while running
-    # the tests. The name of the dir includes the pid to allow parallel
-    # testing (see the -j option).
-    TESTCWD = 'test_python_{}'.format(os.getpid())
-
-    TESTCWD = os.path.join(TEMPDIR, TESTCWD)
-
-    # Run the tests in a context manager that temporary changes the CWD to a
-    # temporary and writable directory. If it's not possible to create or
-    # change the CWD, the original CWD will be used. The original CWD is
-    # available from test_support.SAVEDCWD.
-    with test_support.temp_cwd(TESTCWD, quiet=True):
-        main()
+    # do not change directory, because it breaks distutils tests
+    main()