diff --git a/.travis.yml b/.travis.yml index 2e3750788..035efb79d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,7 +51,7 @@ matrix: install: - wget https://github.com/gohugoio/hugo/releases/download/v0.41/hugo_0.41_Linux-64bit.deb - sudo dpkg -i hugo*.deb - - pip install tox virtualenv setuptools + - pip install -U tox virtualenv setuptools script: - tox after_success: @@ -68,7 +68,7 @@ install: pyenv global 3.6.9 pyenv shell 3.6.9 fi - - pip install tox virtualenv setuptools + - pip install -U tox virtualenv setuptools script: # All these steps MUST succeed for the job to be successful! diff --git a/examples/__init__.py b/examples/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/examples/complex/__init__.py b/examples/complex/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/setup.py b/setup.py index 180058a21..a40df8f7d 100644 --- a/setup.py +++ b/setup.py @@ -76,8 +76,8 @@ setup( "pyOpenSSL>=19.0.0,<20", "pyparsing>=2.4.2,<2.5", "pyperclip>=1.6.0,<1.8", - "ruamel.yaml>=0.15,<0.16", - "sortedcontainers>=1.5.4,<2.1", + "ruamel.yaml>=0.16,<0.17", + "sortedcontainers>=2.1.0,<2.2", "tornado>=4.3,<5.2", "urwid>=2.0.1,<2.1", "wsproto>=0.14.0,<0.15.0", @@ -101,7 +101,7 @@ setup( "pytest-xdist>=1.22,<2", "pytest>=4.0,<5", "requests>=2.9.1, <3", - "tox>=3.5,<3.6", + "tox>=3.5,<3.15", "rstcheck>=2.2, <4.0", ], 'examples': [ diff --git a/test/full_coverage_plugin.py b/test/full_coverage_plugin.py index ec30a9f92..f99dc7ab8 100644 --- a/test/full_coverage_plugin.py +++ b/test/full_coverage_plugin.py @@ -55,7 +55,7 @@ def pytest_runtestloop(session): yield return - cov = pytest.config.pluginmanager.getplugin("_cov").cov_controller.cov + cov = session.config.pluginmanager.getplugin("_cov").cov_controller.cov if os.name == 'nt': cov.exclude('pragma: windows no cover') @@ -68,7 +68,7 @@ def pytest_runtestloop(session): yield - coverage_values = dict([(name, 0) for name in pytest.config.option.full_cov]) + coverage_values = dict([(name, 0) for name in session.config.option.full_cov]) prefix = os.getcwd() @@ -92,7 +92,7 @@ def pytest_runtestloop(session): coverage_passed = False -def pytest_terminal_summary(terminalreporter, exitstatus): +def pytest_terminal_summary(terminalreporter, exitstatus, config): global enable_coverage global coverage_values global coverage_passed @@ -119,7 +119,7 @@ def pytest_terminal_summary(terminalreporter, exitstatus): terminalreporter.write(msg, **markup) else: msg = 'SUCCESS: Full test coverage reached in modules and files:\n' - msg += '{}\n\n'.format('\n'.join(pytest.config.option.full_cov)) + msg += '{}\n\n'.format('\n'.join(config.option.full_cov)) terminalreporter.write(msg, green=True) msg = '\nExcluded files:\n' diff --git a/test/mitmproxy/net/test_tls.py b/test/mitmproxy/net/test_tls.py index 489bf89fc..68e67dbe0 100644 --- a/test/mitmproxy/net/test_tls.py +++ b/test/mitmproxy/net/test_tls.py @@ -87,13 +87,13 @@ def test_get_client_hello(): rfile = io.BufferedReader(io.BytesIO( FULL_CLIENT_HELLO_NO_EXTENSIONS[:30] )) - with pytest.raises(exceptions.TlsProtocolException, message="Unexpected EOF"): + with pytest.raises(exceptions.TlsProtocolException, match="Unexpected EOF"): tls.get_client_hello(rfile) rfile = io.BufferedReader(io.BytesIO( b"GET /" )) - with pytest.raises(exceptions.TlsProtocolException, message="Expected TLS record"): + with pytest.raises(exceptions.TlsProtocolException, match="Expected TLS record"): tls.get_client_hello(rfile) @@ -153,5 +153,5 @@ class TestClientHello: b"\x01\x00\x00\x03" + # handshake header b"foo" )) - with pytest.raises(exceptions.TlsProtocolException, message='Cannot parse Client Hello'): + with pytest.raises(exceptions.TlsProtocolException, match='Cannot parse Client Hello'): tls.ClientHello.from_file(rfile)