aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2016-09-23 11:59:39 +0200
committerGuido Günther <agx@sigxcpu.org>2016-09-23 12:06:44 +0200
commitfa101afec1d8fae56d6f1d9489ea1672ceefdcea (patch)
tree020c28226bd0c1a6c12d1515cd747a94ecd0c0d8
parentac345eb4059c5e59a0b4782ee6b8c20a2486331a (diff)
tests/context.py: flake8 clean
-rw-r--r--tests/context.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/context.py b/tests/context.py
index 5878771..8900a30 100644
--- a/tests/context.py
+++ b/tests/context.py
@@ -29,19 +29,22 @@ projectdir = os.path.dirname(os.path.dirname(os.path.abspath(whatmaps.__file__))
_chdir_backup = None
_tmpdirs = []
+
def chdir(dir):
global _chdir_backup
if not _chdir_backup:
_chdir_backup = os.path.abspath(os.curdir)
os.chdir(str(dir))
+
def new_tmpdir(name):
global _tmpdirs
- prefix='whatmaps_%s_' % name
+ prefix = 'whatmaps_%s_' % name
tmpdir = TmpDir(prefix)
_tmpdirs.append(tmpdir)
return tmpdir
+
def teardown():
if _chdir_backup:
os.chdir(_chdir_backup)
@@ -49,6 +52,7 @@ def teardown():
tmpdir.rmdir()
del _tmpdirs[:]
+
class TmpDir(object):
def __init__(self, suffix='', prefix='tmp'):