diff options
| author | Claude Paroz <claude@2xlibre.net> | 2012-08-13 10:58:21 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2012-08-13 10:58:21 +0200 |
| commit | 73f0f18c8fc04a03bbfb20794aabb95944c90f63 (patch) | |
| tree | 79dfda883d595bdd4f6d93d7061a3e48207f147d /tests/regressiontests/admin_scripts/tests.py | |
| parent | a06503d09b73fa2842ec79170b84453034fca904 (diff) | |
[py3] Fixed admin_scripts tests
Diffstat (limited to 'tests/regressiontests/admin_scripts/tests.py')
| -rw-r--r-- | tests/regressiontests/admin_scripts/tests.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/regressiontests/admin_scripts/tests.py b/tests/regressiontests/admin_scripts/tests.py index 546fa7d79c..a8fc7ed503 100644 --- a/tests/regressiontests/admin_scripts/tests.py +++ b/tests/regressiontests/admin_scripts/tests.py @@ -71,6 +71,10 @@ class AdminScriptTestCase(unittest.TestCase): os.remove(full_name + 'c') except OSError: pass + # Also remove a __pycache__ directory, if it exists + cache_name = os.path.join(test_dir, '__pycache__') + if os.path.isdir(cache_name): + shutil.rmtree(cache_name) def _ext_backend_paths(self): """ @@ -110,14 +114,11 @@ class AdminScriptTestCase(unittest.TestCase): python_path.extend(ext_backend_base_dirs) os.environ[python_path_var_name] = os.pathsep.join(python_path) - # Silence the DeprecationWarning caused by having a locale directory - # in the project directory. - cmd = [sys.executable, '-Wignore:::django.utils.translation', script] - # Move to the test directory and run os.chdir(test_dir) - out, err = subprocess.Popen(cmd + args, - stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() + out, err = subprocess.Popen([sys.executable, script] + args, + stdout=subprocess.PIPE, stderr=subprocess.PIPE, + universal_newlines=True).communicate() # Restore the old environment if old_django_settings_module: |
