diff options
author | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2017-03-12 22:55:22 +0100 |
---|---|---|
committer | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2017-03-12 22:55:22 +0100 |
commit | 1b045d24bccd68f6db1e15c655af192cb5217a6a (patch) | |
tree | e25684ad8daf7d0ab59dc15d7dda40f59f5f066c /mitmproxy/test | |
parent | d069ba9da58beb65d8139c728cc20abcb01de3a4 (diff) | |
download | mitmproxy-1b045d24bccd68f6db1e15c655af192cb5217a6a.tar.gz mitmproxy-1b045d24bccd68f6db1e15c655af192cb5217a6a.tar.bz2 mitmproxy-1b045d24bccd68f6db1e15c655af192cb5217a6a.zip |
nuke tutils.tmpdir, use pytest tmpdir
Diffstat (limited to 'mitmproxy/test')
-rw-r--r-- | mitmproxy/test/tutils.py | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/mitmproxy/test/tutils.py b/mitmproxy/test/tutils.py index 7b311492..80e5b6fd 100644 --- a/mitmproxy/test/tutils.py +++ b/mitmproxy/test/tutils.py @@ -1,9 +1,5 @@ -from io import BytesIO -import tempfile -import os import time -import shutil -from contextlib import contextmanager +from io import BytesIO from mitmproxy.utils import data from mitmproxy.net import tcp @@ -13,18 +9,6 @@ from mitmproxy.net import http test_data = data.Data(__name__).push("../../test/") -@contextmanager -def tmpdir(*args, **kwargs): - orig_workdir = os.getcwd() - temp_workdir = tempfile.mkdtemp(*args, **kwargs) - os.chdir(temp_workdir) - - yield temp_workdir - - os.chdir(orig_workdir) - shutil.rmtree(temp_workdir) - - def treader(bytes): """ Construct a tcp.Read object from bytes. |