From eeec17902fdcd7de766dc79ed6a2e3a73ad4ce3d Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sat, 24 Sep 2016 21:01:48 -0700 Subject: update dependencies, minor fixes (#1577) --- mitmproxy/dump.py | 15 +++++++++------ setup.cfg | 2 +- setup.py | 6 +++--- test/mitmproxy/test_dump.py | 4 +--- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/mitmproxy/dump.py b/mitmproxy/dump.py index 3d725ca1..6bed8fcc 100644 --- a/mitmproxy/dump.py +++ b/mitmproxy/dump.py @@ -1,7 +1,5 @@ from __future__ import absolute_import, print_function, division -import sys - from typing import Optional # noqa import typing # noqa @@ -49,12 +47,17 @@ class DumpMaster(flow.FlowMaster): self.set_stream_large_bodies(options.stream_large_bodies) if not self.options.no_server and server: - print("Proxy server listening at http://{}".format(server.address)) + self.add_log( + "Proxy server listening at http://{}".format(server.address), + "info" + ) if self.server and self.options.http2 and not tcp.HAS_ALPN: # pragma: no cover - print("ALPN support missing (OpenSSL 1.0.2+ required)!\n" - "HTTP/2 is disabled. Use --no-http2 to silence this warning.", - file=sys.stderr) + self.add_log( + "ALPN support missing (OpenSSL 1.0.2+ required)!\n" + "HTTP/2 is disabled. Use --no-http2 to silence this warning.", + "error" + ) if options.rfile: try: diff --git a/setup.cfg b/setup.cfg index 7cbbf81b..47fe119a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,7 +5,7 @@ ignore = E251,C901 exclude = mitmproxy/contrib/*,test/mitmproxy/data/* builtins = file,open,basestring,xrange,unicode,long,cmp -[pytest] +[tool:pytest] testpaths = test addopts = --capture=no --color=yes diff --git a/setup.py b/setup.py index 9f75ca15..eec05148 100644 --- a/setup.py +++ b/setup.py @@ -64,13 +64,13 @@ setup( "blinker>=1.4, <1.5", "click>=6.2, <7.0", "certifi>=2015.11.20.1", # no semver here - this should always be on the last release! - "configargparse>=0.10, <0.11", + "configargparse>=0.10, <0.12", "construct>=2.5.2, <2.6", "cryptography>=1.3, <1.6", "cssutils>=1.0.1, <1.1", "Flask>=0.10.1, <0.12", "h2>=2.4.1, <3", - "html2text>=2016.1.8, <=2016.5.29", + "html2text>=2016.1.8, <=2016.9.19", "hyperframe>=4.0.1, <5", "jsbeautifier>=1.6.3, <1.7", "lxml>=3.5.0, <=3.6.0", # no wheels for 3.6.1 yet. @@ -103,7 +103,7 @@ setup( 'dev': [ "tox>=2.3, <3", "mock>=2.0, <2.1", - "pytest>=2.8.7, <3", + "pytest>=3, <3.1", "pytest-cov>=2.2.1, <3", "pytest-timeout>=1.0.0, <2", "pytest-xdist>=1.14, <2", diff --git a/test/mitmproxy/test_dump.py b/test/mitmproxy/test_dump.py index 06f39e9d..644a3d54 100644 --- a/test/mitmproxy/test_dump.py +++ b/test/mitmproxy/test_dump.py @@ -3,7 +3,6 @@ from six.moves import cStringIO as StringIO from mitmproxy import dump, flow, exceptions from . import tutils, mastertest -import mock class TestDumpMaster(mastertest.MasterTest): @@ -102,8 +101,7 @@ class TestDumpMaster(mastertest.MasterTest): def test_app(self): o = dump.Options(app=True) - s = mock.MagicMock() - m = dump.DumpMaster(s, o) + m = dump.DumpMaster(None, o) assert len(m.apps.apps) == 1 def test_replacements(self): -- cgit v1.2.3