summaryrefslogtreecommitdiff
path: root/cherrypy
diff options
context:
space:
mode:
Diffstat (limited to 'cherrypy')
-rw-r--r--cherrypy/test/helper.py5
-rw-r--r--cherrypy/test/test_core.py8
2 files changed, 7 insertions, 6 deletions
diff --git a/cherrypy/test/helper.py b/cherrypy/test/helper.py
index fa3b89f8..e3006a52 100644
--- a/cherrypy/test/helper.py
+++ b/cherrypy/test/helper.py
@@ -300,8 +300,9 @@ class CPWebCase(webtest.WebCase):
if self.do_gc_test:
self.getPage("/gc/stats")
self.assertBody("Statistics:")
- # Tell nose to run this last in each class
- test_gc.compat_co_firstlineno = float('inf')
+ # Tell nose to run this last in each class.
+ # Prefer sys.maxint for Python 2.3, which didn't have float('inf')
+ test_gc.compat_co_firstlineno = getattr(sys, 'maxint', None) or float('inf')
def prefix(self):
return self.script_name.rstrip("/")
diff --git a/cherrypy/test/test_core.py b/cherrypy/test/test_core.py
index 3c39f5cd..0956a94a 100644
--- a/cherrypy/test/test_core.py
+++ b/cherrypy/test/test_core.py
@@ -262,12 +262,12 @@ class CoreRequestHandlingTest(helper.CPWebCase):
class MultiHeader(Test):
- @cherrypy.tools.append_headers(header_list=[
- (ntob('WWW-Authenticate'), ntob('Negotiate')),
- (ntob('WWW-Authenticate'), ntob('Basic realm="foo"')),
- ])
def header_list(self):
pass
+ header_list = cherrypy.tools.append_headers(header_list=[
+ (ntob('WWW-Authenticate'), ntob('Negotiate')),
+ (ntob('WWW-Authenticate'), ntob('Basic realm="foo"')),
+ ])(header_list)
def commas(self):
cherrypy.response.headers['WWW-Authenticate'] = 'Negotiate,Basic realm="foo"'