diff options
| author | Claude Paroz <claude@2xlibre.net> | 2017-12-21 16:31:59 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2017-12-23 10:26:32 +0100 |
| commit | 23b21db31bfcf2a065d485617412cca43a311a4c (patch) | |
| tree | 5b77d64166f2570805dbe915dcd398551ec58f3a /tests/admin_scripts/tests.py | |
| parent | 32ade4d73b50aed77efdb9dd7371c17f89061afc (diff) | |
Fixed #28594 -- Removed Jython docs and specific code
Thanks Andrey Martyanov for the reporti, and Tim Graham for the review.
Diffstat (limited to 'tests/admin_scripts/tests.py')
| -rw-r--r-- | tests/admin_scripts/tests.py | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py index 18ef36cd08..e9f5a1897b 100644 --- a/tests/admin_scripts/tests.py +++ b/tests/admin_scripts/tests.py @@ -100,15 +100,8 @@ class AdminScriptTestCase(unittest.TestCase): else: os.remove(full_name) - # Also try to remove the compiled file; if it exists, it could + # Also remove a __pycache__ directory, if it exists; it could # mess up later tests that depend upon the .py file not existing - try: - if sys.platform.startswith('java'): - # Jython produces module$py.class files - os.remove(re.sub(r'\.py$', '$py.class', full_name)) - except OSError: - pass - # Also remove a __pycache__ directory, if it exists cache_name = os.path.join(self.test_dir, '__pycache__') if os.path.isdir(cache_name): shutil.rmtree(cache_name) @@ -138,11 +131,6 @@ class AdminScriptTestCase(unittest.TestCase): # Define a temporary environment for the subprocess test_environ = os.environ.copy() - if sys.platform.startswith('java'): - python_path_var_name = 'JYTHONPATH' - else: - python_path_var_name = 'PYTHONPATH' - old_cwd = os.getcwd() # Set the test environment @@ -152,7 +140,7 @@ class AdminScriptTestCase(unittest.TestCase): del test_environ['DJANGO_SETTINGS_MODULE'] python_path = [base_dir, django_dir, tests_dir] python_path.extend(ext_backend_base_dirs) - test_environ[python_path_var_name] = os.pathsep.join(python_path) + test_environ['PYTHONPATH'] = os.pathsep.join(python_path) test_environ['PYTHONWARNINGS'] = '' # Move to the test directory and run |
