diff options
author | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2017-05-24 14:09:41 +0200 |
---|---|---|
committer | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2017-05-24 14:09:41 +0200 |
commit | ae7e9efb5ca014291e879694414bbffc982f2a0d (patch) | |
tree | 6ada273eb6d6f0cc9cf04a9d002ee8481d9cce41 /test/pathod/language/test_base.py | |
parent | 2faaa0b2a23089b9ffccf2d46dc42328edb76ddd (diff) | |
download | mitmproxy-ae7e9efb5ca014291e879694414bbffc982f2a0d.tar.gz mitmproxy-ae7e9efb5ca014291e879694414bbffc982f2a0d.tar.bz2 mitmproxy-ae7e9efb5ca014291e879694414bbffc982f2a0d.zip |
fix various fd/socket leaks
Diffstat (limited to 'test/pathod/language/test_base.py')
-rw-r--r-- | test/pathod/language/test_base.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/pathod/language/test_base.py b/test/pathod/language/test_base.py index ec460b07..910d298a 100644 --- a/test/pathod/language/test_base.py +++ b/test/pathod/language/test_base.py @@ -202,12 +202,14 @@ class TestMisc: e.parseString("m@1") s = base.Settings(staticdir=str(tmpdir)) - tmpdir.join("path").write_binary(b"a" * 20, ensure=True) + with open(str(tmpdir.join("path")), 'wb') as f: + f.write(b"a" * 20) v = e.parseString("m<path")[0] with pytest.raises(Exception, match="Invalid value length"): v.values(s) - tmpdir.join("path2").write_binary(b"a" * 4, ensure=True) + with open(str(tmpdir.join("path2")), 'wb') as f: + f.write(b"a" * 4) v = e.parseString("m<path2")[0] assert v.values(s) |