diff options
author | Mickaël Schoentgen <contact@tiger-222.fr> | 2019-01-05 23:20:39 +0100 |
---|---|---|
committer | Mickaël Schoentgen <contact@tiger-222.fr> | 2019-01-05 23:37:48 +0100 |
commit | 3a2d7bb119828613f2a40b936b1a4d5c40125ccb (patch) | |
tree | 4bad85cba8497e3c5fbfe2fb95c2ea50b6639a2e /test | |
parent | 889987aa0a7f4852758ed09f70fe5d30f733a6d3 (diff) | |
download | mitmproxy-3a2d7bb119828613f2a40b936b1a4d5c40125ccb.tar.gz mitmproxy-3a2d7bb119828613f2a40b936b1a4d5c40125ccb.tar.bz2 mitmproxy-3a2d7bb119828613f2a40b936b1a4d5c40125ccb.zip |
Fix several DeprecationWarning: invalid escape sequence
Signed-off-by: Mickaël Schoentgen <contact@tiger-222.fr>
Diffstat (limited to 'test')
-rw-r--r-- | test/mitmproxy/coretypes/test_basethread.py | 2 | ||||
-rw-r--r-- | test/mitmproxy/net/http/test_cookies.py | 4 | ||||
-rw-r--r-- | test/mitmproxy/net/test_tcp.py | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/test/mitmproxy/coretypes/test_basethread.py b/test/mitmproxy/coretypes/test_basethread.py index 4a383fea..6b0ae154 100644 --- a/test/mitmproxy/coretypes/test_basethread.py +++ b/test/mitmproxy/coretypes/test_basethread.py @@ -4,4 +4,4 @@ from mitmproxy.coretypes import basethread def test_basethread(): t = basethread.BaseThread('foobar') - assert re.match('foobar - age: \d+s', t._threadinfo()) + assert re.match(r'foobar - age: \d+s', t._threadinfo()) diff --git a/test/mitmproxy/net/http/test_cookies.py b/test/mitmproxy/net/http/test_cookies.py index 74233cca..06cfe1d3 100644 --- a/test/mitmproxy/net/http/test_cookies.py +++ b/test/mitmproxy/net/http/test_cookies.py @@ -27,7 +27,7 @@ cookie_pairs = [ [["one", "uno"], ["two", "due"]] ], [ - 'one="uno"; two="\due"', + 'one="uno"; two="\\due"', [["one", "uno"], ["two", "due"]] ], [ @@ -70,7 +70,7 @@ def test_read_key(): def test_read_quoted_string(): tokens = [ [('"foo" x', 0), ("foo", 5)], - [('"f\oo" x', 0), ("foo", 6)], + [('"f\\oo" x', 0), ("foo", 6)], [(r'"f\\o" x', 0), (r"f\o", 6)], [(r'"f\\" x', 0), (r"f" + '\\', 5)], [('"fo\\\"" x', 0), ("fo\"", 6)], diff --git a/test/mitmproxy/net/test_tcp.py b/test/mitmproxy/net/test_tcp.py index b6bb7cc1..22a306dc 100644 --- a/test/mitmproxy/net/test_tcp.py +++ b/test/mitmproxy/net/test_tcp.py @@ -102,7 +102,7 @@ class TestServerBind(tservers.ServerTestBase): # We may get an ipv4-mapped ipv6 address here, e.g. ::ffff:127.0.0.1. # Those still appear as "127.0.0.1" in the table, so we need to strip the prefix. peername = self.connection.getpeername() - address = re.sub("^::ffff:(?=\d+.\d+.\d+.\d+$)", "", peername[0]) + address = re.sub(r"^::ffff:(?=\d+.\d+.\d+.\d+$)", "", peername[0]) port = peername[1] self.wfile.write(str((address, port)).encode()) |