From d18d37ce291e8dae4c9444afa5ab59f99bd45ecc Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Fri, 31 Dec 2010 14:22:55 +0000 Subject: Added our own rmtree error handler to make sure we can delete correctly delete .svn directories when running the tests on Windows which are read-only for some reason. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15120 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/staticfiles_tests/tests.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/regressiontests/staticfiles_tests/tests.py b/tests/regressiontests/staticfiles_tests/tests.py index 35ee74393b..cf532bb414 100644 --- a/tests/regressiontests/staticfiles_tests/tests.py +++ b/tests/regressiontests/staticfiles_tests/tests.py @@ -13,6 +13,7 @@ from django.core.management import call_command from django.db.models.loading import load_app from django.template import Template, Context from django.test import TestCase +from django.utils._os import rmtree_errorhandler TEST_ROOT = os.path.normcase(os.path.dirname(__file__)) @@ -97,7 +98,9 @@ class BuildStaticTestCase(StaticFilesTestCase): self.run_collectstatic() def tearDown(self): - shutil.rmtree(settings.STATIC_ROOT) + # Use our own error handler that can handle .svn dirs on Windows + shutil.rmtree(settings.STATIC_ROOT, ignore_errors=True, + onerror=rmtree_errorhandler) settings.STATIC_ROOT = self.old_root super(BuildStaticTestCase, self).tearDown() -- cgit v1.3