[damned-lies] Put test scratch dir outside the source tree
- From: Claude Paroz <claudep src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [damned-lies] Put test scratch dir outside the source tree
- Date: Tue, 11 Aug 2015 15:36:39 +0000 (UTC)
commit d3e2bc57b32114abc9149b91ca1ad2f8c104e942
Author: Claude Paroz <claude 2xlibre net>
Date: Tue Aug 11 17:34:23 2015 +0200
Put test scratch dir outside the source tree
Should fix bug #753514.
stats/tests/tests.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/stats/tests/tests.py b/stats/tests/tests.py
index 6a9dce4..9f01cca 100644
--- a/stats/tests/tests.py
+++ b/stats/tests/tests.py
@@ -20,6 +20,7 @@
import os
import shutil
import tarfile
+import tempfile
from datetime import date
from functools import wraps
@@ -42,7 +43,7 @@ def test_scratchdir(test_func):
def decorator(self):
old_SCRATCHDIR = settings.SCRATCHDIR
old_POTDIR = settings.POTDIR
- settings.SCRATCHDIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'scratch')
+ settings.SCRATCHDIR = os.path.join(tempfile.mkdtemp(), 'scratch')
settings.POTDIR = os.path.join(settings.SCRATCHDIR, "POT")
os.makedirs(settings.POTDIR)
gnome_hello_tar = tarfile.open(os.path.join(os.path.dirname(os.path.abspath(__file__)),
'gnome-hello.tar.gz'))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]