summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉloi Rivard <eloi.rivard@aquilenet.fr>2022-01-16 18:37:52 +0100
committerÉloi Rivard <eloi.rivard@aquilenet.fr>2022-01-16 18:43:47 +0100
commit6b936d525ba8639d449ea4b84c5c9cc208ef7441 (patch)
tree7bbb1c8f0e0a0442f8eff5c4a880a7a4904b4af5
parentca58f4d1712d87397e84ed30fd87475c6a814d32 (diff)
downloadwebtest-6b936d525ba8639d449ea4b84c5c9cc208ef7441.tar.gz
stop python3.6 support
-rw-r--r--.github/workflows/ci-tests.yml2
-rw-r--r--setup.py4
-rw-r--r--tox.ini2
-rw-r--r--webtest/app.py2
-rw-r--r--webtest/debugapp.py4
-rw-r--r--webtest/forms.py2
-rw-r--r--webtest/http.py2
-rw-r--r--webtest/lint.py6
-rw-r--r--webtest/response.py4
9 files changed, 14 insertions, 14 deletions
diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml
index 4d7a1cc..38f34e7 100644
--- a/.github/workflows/ci-tests.yml
+++ b/.github/workflows/ci-tests.yml
@@ -14,10 +14,10 @@ jobs:
strategy:
matrix:
py:
- - "3.6"
- "3.7"
- "3.8"
- "3.9"
+ - "3.10"
os:
- "ubuntu-latest"
- "macos-latest"
diff --git a/setup.py b/setup.py
index 460b4c5..ec85910 100644
--- a/setup.py
+++ b/setup.py
@@ -39,10 +39,10 @@ setup(name='WebTest',
"Topic :: Internet :: WWW/HTTP :: WSGI :: Server",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
- "Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
+ "Programming Language :: Python :: 3.10",
],
keywords='wsgi test unit tests web',
author='Ian Bicking',
@@ -59,7 +59,7 @@ setup(name='WebTest',
]),
include_package_data=True,
zip_safe=False,
- python_requires='>=3.6, <4',
+ python_requires='>=3.7, <4',
install_requires=install_requires,
tests_require=tests_require,
extras_require={
diff --git a/tox.ini b/tox.ini
index 42fb958..563c5fe 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,7 +1,7 @@
[tox]
skip_missing_interpreters = true
envlist =
- py36,py37,py38,py39,
+ py37,py38,py39,py310
coverage,
docs
diff --git a/webtest/app.py b/webtest/app.py
index f5cd41b..4ea19e9 100644
--- a/webtest/app.py
+++ b/webtest/app.py
@@ -210,7 +210,7 @@ class TestApp:
val = val.strip()
else:
raise ValueError(invalid_value)
- value = str('%s %s' % (authtype, val))
+ value = str(f'{authtype} {val}')
else:
raise ValueError(invalid_value)
self.extra_environ.update({
diff --git a/webtest/debugapp.py b/webtest/debugapp.py
index b7e8ddc..4b1eb68 100644
--- a/webtest/debugapp.py
+++ b/webtest/debugapp.py
@@ -39,7 +39,7 @@ class DebugApp:
for name, value in sorted(environ.items()):
if name.upper() != name:
value = repr(value)
- parts.append('%s: %s\n' % (name, value))
+ parts.append(f'{name}: {value}\n')
body = ''.join(parts)
if not isinstance(body, bytes):
@@ -51,7 +51,7 @@ class DebugApp:
else:
body = ''
for name, value in req.POST.items():
- body += '%s=%s\n' % (name, value)
+ body += f'{name}={value}\n'
if status[:3] in ('204', '304') and not req.content_length:
body = ''
diff --git a/webtest/forms.py b/webtest/forms.py
index d0b8c32..d2d6bfc 100644
--- a/webtest/forms.py
+++ b/webtest/forms.py
@@ -90,7 +90,7 @@ class Field:
self._value = value
def __repr__(self):
- value = '<%s name="%s"' % (self.__class__.__name__, self.name)
+ value = f'<{self.__class__.__name__} name="{self.name}"'
if self.id:
value += ' id="%s"' % self.id
return value + '>'
diff --git a/webtest/http.py b/webtest/http.py
index efe4ace..3d18ed2 100644
--- a/webtest/http.py
+++ b/webtest/http.py
@@ -55,7 +55,7 @@ class StopableWSGIServer(TcpWSGIServer):
super().__init__(self.wrapper, *args, **kwargs)
self.runner = None
self.test_app = application
- self.application_url = 'http://%s:%s/' % (self.adj.host, self.adj.port)
+ self.application_url = f'http://{self.adj.host}:{self.adj.port}/'
def wrapper(self, environ, start_response):
"""Wrap the wsgi application to override some path:
diff --git a/webtest/lint.py b/webtest/lint.py
index c5a7caa..a06fe6a 100644
--- a/webtest/lint.py
+++ b/webtest/lint.py
@@ -417,7 +417,7 @@ def check_errors(wsgi_errors):
def check_status(status):
if type(status) not in METADATA_TYPE:
- raise AssertionError("Status must be a %s (not %r)" % (METADATA_TYPE, status))
+ raise AssertionError(f"Status must be a {METADATA_TYPE} (not {status!r})")
status = to_string(status)
@@ -461,7 +461,7 @@ def _assert_latin1_str(string, message):
def check_headers(headers):
if type(headers) is not list:
raise AssertionError(
- "Headers (%r) must be of type list: %r" % (headers, type(headers))
+ f"Headers ({headers!r}) must be of type list: {type(headers)!r}"
)
for item in headers:
@@ -547,7 +547,7 @@ def check_content_type(status, headers):
def check_exc_info(exc_info):
if exc_info is not None and type(exc_info) is not tuple:
raise AssertionError(
- "exc_info (%r) is not a tuple: %r" % (exc_info, type(exc_info))
+ f"exc_info ({exc_info!r}) is not a tuple: {type(exc_info)!r}"
)
# More exc_info checks?
diff --git a/webtest/response.py b/webtest/response.py
index 8c4f87e..3f30d44 100644
--- a/webtest/response.py
+++ b/webtest/response.py
@@ -351,9 +351,9 @@ class TestResponse(webob.Response):
for n, v in self.headerlist
if n.lower() != 'content-length']
headers.sort()
- output = 'Response: %s\n%s\n%s' % (
+ output = 'Response: {}\n{}\n{}'.format(
self.status,
- '\n'.join(['%s: %s' % (n, v) for n, v in headers]),
+ '\n'.join([f'{n}: {v}' for n, v in headers]),
simple_body)
return output