aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorThomas Kriechbaumer <thomas@kriechbaumer.name>2017-02-01 16:48:46 +0100
committerThomas Kriechbaumer <thomas@kriechbaumer.name>2017-02-02 17:26:31 +0100
commit79aa99427550e738007e8b87d41e5c097cd06c46 (patch)
treedb4a51e4d5fc31991726c9f5050627a08d06acc8 /test
parent8b6e3d8bd37ad2f806b55cf5974ed9c3d73596ac (diff)
downloadmitmproxy-79aa99427550e738007e8b87d41e5c097cd06c46.tar.gz
mitmproxy-79aa99427550e738007e8b87d41e5c097cd06c46.tar.bz2
mitmproxy-79aa99427550e738007e8b87d41e5c097cd06c46.zip
fix merge
Diffstat (limited to 'test')
-rw-r--r--test/conftest.py2
-rw-r--r--test/mitmproxy/addons/test_view.py8
2 files changed, 5 insertions, 5 deletions
diff --git a/test/conftest.py b/test/conftest.py
index c44aa461..4b05624b 100644
--- a/test/conftest.py
+++ b/test/conftest.py
@@ -29,8 +29,8 @@ skip_appveyor = pytest.mark.skipif(
original_pytest_raises = pytest.raises
+@functools.wraps(original_pytest_raises)
def raises(exc, *args, **kwargs):
- functools.wraps(original_pytest_raises)
if isinstance(exc, str):
return RaisesContext(exc)
else:
diff --git a/test/mitmproxy/addons/test_view.py b/test/mitmproxy/addons/test_view.py
index 60736af7..99b12cb4 100644
--- a/test/mitmproxy/addons/test_view.py
+++ b/test/mitmproxy/addons/test_view.py
@@ -172,9 +172,9 @@ def test_reversed():
assert v[-1].request.timestamp_start == 1
assert v[2].request.timestamp_start == 1
with pytest.raises(IndexError):
- v.__getitem__(5)
+ v[5]
with pytest.raises(IndexError):
- v.__getitem__(-5)
+ v[-5]
assert v._bisect(v[0]) == 1
assert v._bisect(v[2]) == 3
@@ -368,14 +368,14 @@ def test_settings():
f = tft()
with pytest.raises(KeyError):
- v.settings.__getitem__(f)
+ v.settings[f]
v.add(f)
v.settings[f]["foo"] = "bar"
assert v.settings[f]["foo"] == "bar"
assert len(list(v.settings)) == 1
v.remove(f)
with pytest.raises(KeyError):
- v.settings.__getitem__(f)
+ v.settings[f]
assert not v.settings.keys()
v.add(f)