aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
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)