From fa101afec1d8fae56d6f1d9489ea1672ceefdcea Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Fri, 23 Sep 2016 11:59:39 +0200 Subject: tests/context.py: flake8 clean --- tests/context.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests/context.py') 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'): -- cgit v1.2.3