You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2013/02/15 02:18:57 UTC
svn commit: r1446417 -
/subversion/trunk/subversion/tests/cmdline/svntest/sandbox.py
Author: rhuijben
Date: Fri Feb 15 01:18:57 2013
New Revision: 1446417
URL: http://svn.apache.org/r1446417
Log:
* subversion/tests/cmdline/svntest/sandbox.py
Don't create a temp directory for every test directly, but wait till
somebody asks for the tempdir. This should remove +- 50% of the
directories in svn-test-work when not running with cleanup.
Modified:
subversion/trunk/subversion/tests/cmdline/svntest/sandbox.py
Modified: subversion/trunk/subversion/tests/cmdline/svntest/sandbox.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svntest/sandbox.py?rev=1446417&r1=1446416&r2=1446417&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svntest/sandbox.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svntest/sandbox.py Fri Feb 15 01:18:57 2013
@@ -37,6 +37,7 @@ class Sandbox:
a test to operate within."""
dependents = None
+ tmp_dir = None
def __init__(self, module, idx):
self.test_paths = []
@@ -45,10 +46,6 @@ class Sandbox:
# This flag is set to True by build() and returned by is_built()
self._is_built = False
- # Create an empty directory for temporary files
- self.tmp_dir = self.add_wc_path('tmp', remove=True)
- os.mkdir(self.tmp_dir)
-
def _set_name(self, name, read_only=False):
"""A convenience method for renaming a sandbox, useful when
working with multiple repositories in the same unit test."""
@@ -159,6 +156,11 @@ class Sandbox:
"""Get a stable name for a temporary file that will be removed after
running the test"""
+ if not self.tmp_dir:
+ # Create an empty directory for temporary files
+ self.tmp_dir = self.add_wc_path('tmp', remove=True)
+ os.mkdir(self.tmp_dir)
+
self.tempname_offs = self.tempname_offs + 1
return os.path.join(self.tmp_dir, '%s-%s' % (prefix, self.tempname_offs))