diff options
author | Sylvain Hellegouarch <sh@defuze.org> | 2015-02-23 08:44:48 +0100 |
---|---|---|
committer | Sylvain Hellegouarch <sh@defuze.org> | 2015-02-23 08:44:48 +0100 |
commit | ad4ebce06eac7e488311891dd11563ba5d5653ce (patch) | |
tree | 019a6ae3bcad8119670cdcb1a8400b05928e1d57 | |
parent | 64488cadf01fc28561392f5c73e16e6ca8de90ef (diff) | |
parent | e2be8cf390c8ff1f286cdca6ab0496b61f1b3026 (diff) | |
download | cherrypy-ad4ebce06eac7e488311891dd11563ba5d5653ce.tar.gz |
Merged in nryoung/cherrypy (pull request #90)
Fix several typos and grammar mistakes in the docs.
-rw-r--r-- | cherrypy/LICENSE.txt | 2 | ||||
-rw-r--r-- | cherrypy/process/servers.py | 2 | ||||
-rw-r--r-- | cherrypy/test/helper.py | 19 | ||||
-rw-r--r-- | cherrypy/test/test_conn.py | 3 | ||||
-rw-r--r-- | docs/basics.rst | 2 |
5 files changed, 19 insertions, 9 deletions
diff --git a/cherrypy/LICENSE.txt b/cherrypy/LICENSE.txt index 8db13fb2..87c8bd02 100644 --- a/cherrypy/LICENSE.txt +++ b/cherrypy/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2004-2011, CherryPy Team (team@cherrypy.org)
+Copyright (c) 2004-2015, CherryPy Team (team@cherrypy.org)
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
diff --git a/cherrypy/process/servers.py b/cherrypy/process/servers.py index 6e4694ec..6f8088bd 100644 --- a/cherrypy/process/servers.py +++ b/cherrypy/process/servers.py @@ -124,7 +124,7 @@ class ServerAdapter(object): If you need to start more than one HTTP server (to serve on multiple ports, or protocols, etc.), you can manually register each one and then - start them all with bus.start: + start them all with bus.start:: s1 = ServerAdapter(bus, MyWSGIServer(host='0.0.0.0', port=80)) s2 = ServerAdapter(bus, another.HTTPServer(host='127.0.0.1', SSL=True)) diff --git a/cherrypy/test/helper.py b/cherrypy/test/helper.py index b6ed3277..fd8bb914 100644 --- a/cherrypy/test/helper.py +++ b/cherrypy/test/helper.py @@ -6,6 +6,7 @@ log = logging.getLogger(__name__) import os thisdir = os.path.abspath(os.path.dirname(__file__)) serverpem = os.path.join(os.getcwd(), thisdir, 'test.pem') +import unittest import re import sys @@ -322,10 +323,6 @@ 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. - # 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("/") @@ -405,6 +402,20 @@ class CPWebCase(webtest.WebCase): (dt1, dt2, seconds)) +def _test_method_sorter(_, x, y): + """Monkeypatch the test sorter to always run test_gc last in each suite.""" + if x == 'test_gc': + return 1 + if y == 'test_gc': + return -1 + if x > y: + return 1 + if x < y: + return -1 + return 0 +unittest.TestLoader.sortTestMethodsUsing = _test_method_sorter + + def setup_client(): """Set up the WebCase classes to match the server's socket settings.""" webtest.WebCase.PORT = cherrypy.server.socket_port diff --git a/cherrypy/test/test_conn.py b/cherrypy/test/test_conn.py index 502a3ab3..ab830f3c 100644 --- a/cherrypy/test/test_conn.py +++ b/cherrypy/test/test_conn.py @@ -1,6 +1,5 @@ """Tests for TCP connection handling, including proper and timely close.""" -import httplib import socket import sys import time @@ -802,7 +801,7 @@ class LimitedRequestQueueTests(helper.CPWebCase): else: raise AssertionError("Overflow conn did not get RST. " "Got %s instead" % repr(exc.args)) - except httplib.BadStatusLine: + except BadStatusLine: # This is a special case in OS X. Linux and Windows will # RST correctly. assert sys.platform == 'darwin' diff --git a/docs/basics.rst b/docs/basics.rst index 817d0bcf..3b9b3e68 100644 --- a/docs/basics.rst +++ b/docs/basics.rst @@ -702,7 +702,7 @@ tool. You can serve your own favicon as follows: '/favicon.ico': { 'tools.staticfile.on': True, - 'tools.staticfile.filename:' '/path/to/myfavicon.ico' + 'tools.staticfile.filename': '/path/to/myfavicon.ico' } } ) |