summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/cgiapp_data/form.cgi11
-rw-r--r--tests/test_grantip.py4
-rw-r--r--tests/test_proxy.py5
3 files changed, 16 insertions, 4 deletions
diff --git a/tests/cgiapp_data/form.cgi b/tests/cgiapp_data/form.cgi
index c4c562d..5ad8f68 100755
--- a/tests/cgiapp_data/form.cgi
+++ b/tests/cgiapp_data/form.cgi
@@ -2,13 +2,20 @@
from __future__ import print_function
+import sys
+
+# Quiet warnings in this CGI so that it does not upset tests.
+if not sys.warnoptions:
+ import warnings
+ warnings.simplefilter("ignore")
+
+# TODO: cgi is deprecated and will go away in Python 3.13.
import cgi
-import six
print('Content-type: text/plain')
print('')
-if six.PY3:
+if sys.version_info.major >= 3:
# Python 3: cgi.FieldStorage keeps some field names as unicode and some as
# the repr() of byte strings, duh.
diff --git a/tests/test_grantip.py b/tests/test_grantip.py
index 2ddf7f1..cd5c98a 100644
--- a/tests/test_grantip.py
+++ b/tests/test_grantip.py
@@ -1,7 +1,7 @@
from paste.auth import grantip
from paste.fixture import *
-def test_make_app():
+def _make_app():
def application(environ, start_response):
start_response('200 OK', [('content-type', 'text/plain')])
lines = [
@@ -23,7 +23,7 @@ def test_make_app():
return app
def test_req():
- app = test_make_app()
+ app = _make_app()
def doit(remote_addr):
res = app.get('/', extra_environ={'REMOTE_ADDR': remote_addr})
return res.body
diff --git a/tests/test_proxy.py b/tests/test_proxy.py
index 844f9a0..5f80fef 100644
--- a/tests/test_proxy.py
+++ b/tests/test_proxy.py
@@ -1,6 +1,11 @@
+import pytest
+
from paste import proxy
from paste.fixture import TestApp
+# TODO: Skipping this for now as it is unreliable. Ideally we'd run something
+# locally and not have to rely on external stuff.
+@pytest.mark.skip(reason="httpbin.org is too slow these days")
def test_proxy_to_website():
# Not the most robust test...
# need to test things like POSTing to pages, and getting from pages