diff options
author | Chris Dent <cdent@anticdent.org> | 2018-10-23 17:01:47 +0100 |
---|---|---|
committer | Chris Dent <cdent@anticdent.org> | 2018-10-23 17:01:47 +0100 |
commit | 9fcc98bd3e5bde3a26326f3156845093f84b8832 (patch) | |
tree | f0e7f4980c56e3f296daa1649ae7232bd0e32dd7 /paste/urlmap.py | |
parent | 9a873a24759f69d6414042abdfc2fde21f8cca21 (diff) | |
download | paste-git-9fcc98bd3e5bde3a26326f3156845093f84b8832.tar.gz |
Fix up testing after switch to pytest
pytest exposes many warnings, some but not all of which are cleaned
up here. The main switch is to use html.escape instead of cgi.escape.
This inspired the addition of 'future' to requirements.
The remaining warnings are related to pytest deprecations or over-eager
test discovery.
It is perhaps ironic that the switch to pytest is to avoid nose being
mostly dead, and now we are using features in pytest that pytest wants
to make dead. These are left for later cleanups, which means that
running the tests is noisy.
Diffstat (limited to 'paste/urlmap.py')
-rw-r--r-- | paste/urlmap.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/paste/urlmap.py b/paste/urlmap.py index f721f2d..4ba19c1 100644 --- a/paste/urlmap.py +++ b/paste/urlmap.py @@ -6,7 +6,7 @@ Map URL prefixes to WSGI applications. See ``URLMap`` import re import os -import cgi +import html try: # Python 3 from collections import MutableMapping as DictMixin @@ -114,12 +114,12 @@ class URLMap(DictMixin): ',\n '.join(map(repr, matches))) else: extra = '' - extra += '\nSCRIPT_NAME: %r' % cgi.escape(environ.get('SCRIPT_NAME')) - extra += '\nPATH_INFO: %r' % cgi.escape(environ.get('PATH_INFO')) - extra += '\nHTTP_HOST: %r' % cgi.escape(environ.get('HTTP_HOST')) + extra += '\nSCRIPT_NAME: %r' % html.escape(environ.get('SCRIPT_NAME')) + extra += '\nPATH_INFO: %r' % html.escape(environ.get('PATH_INFO')) + extra += '\nHTTP_HOST: %r' % html.escape(environ.get('HTTP_HOST')) app = httpexceptions.HTTPNotFound( environ['PATH_INFO'], - comment=cgi.escape(extra)).wsgi_application + comment=html.escape(extra)).wsgi_application return app(environ, start_response) def normalize_url(self, url, trim=True): |