aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/test
diff options
context:
space:
mode:
authorThomas Kriechbaumer <thomas@kriechbaumer.name>2017-03-12 22:55:22 +0100
committerThomas Kriechbaumer <thomas@kriechbaumer.name>2017-03-12 22:55:22 +0100
commit1b045d24bccd68f6db1e15c655af192cb5217a6a (patch)
treee25684ad8daf7d0ab59dc15d7dda40f59f5f066c /mitmproxy/test
parentd069ba9da58beb65d8139c728cc20abcb01de3a4 (diff)
downloadmitmproxy-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.py18
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.