Permalink
Browse files

[py3] Fixed admin_scripts tests

  • Loading branch information...
1 parent a06503d commit 73f0f18c8fc04a03bbfb20794aabb95944c90f63 @claudep claudep committed Aug 13, 2012
Showing with 7 additions and 6 deletions.
  1. +7 −6 tests/regressiontests/admin_scripts/tests.py
View
13 tests/regressiontests/admin_scripts/tests.py
@@ -71,6 +71,10 @@ def remove_settings(self, filename, is_dir=False):
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 @@ def run_test(self, script, args, settings_file=None, apps=None):
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:

0 comments on commit 73f0f18

Please sign in to comment.