Issue #2 new

test_response doctest fails with python 2.4

Mariano Mara
repo owner created an issue

Only with python 2.4, tests/test_response.txt fails in several places due to the following error: * TypeError: exceptions must be classes, instances, or strings (deprecated), not HTTPBadRequest.

The offending lines are: 412 and 416. Here's the full traceback:

{{{

!python

Traceback (most recent call last): File "/home/mariano/Sandbox/WEBOB/python/compiled/python2.4/lib/python2.4/doctest.py", line 2157, in runTest raise self.failureException(self.format_failure(new.getvalue())) AssertionError: Failed doctest test for test_response.txt File "/home/mariano/Sandbox/WEBOB/webobtestcoverage/tests/test_response.txt", line 0


File "/home/mariano/Sandbox/WEBOB/webobtestcoverage/tests/test_response.txt", line 412, in test_response.txt Failed example: raise HTTPBadRequest('bad data') Expected: Traceback (most recent call last): ... HTTPBadRequest: bad data Got: Traceback (most recent call last): File "/home/mariano/Sandbox/WEBOB/python/compiled/python2.4/lib/python2.4/doctest.py", line 1248, in __run compileflags, 1) in test.globs File "<doctest test_response.txt[196]>", line 1, in ? raise HTTPBadRequest('bad data') TypeError: exceptions must be classes, instances, or strings (deprecated), not HTTPBadRequest


File "/home/mariano/Sandbox/WEBOB/webobtestcoverage/tests/test_response.txt", line 416, in test_response.txt Failed example: raise HTTPBadRequest() Expected: Traceback (most recent call last): ... HTTPBadRequest: The server could not comply with the request since it is either malformed or otherwise incorrect. Got: Traceback (most recent call last): File "/home/mariano/Sandbox/WEBOB/python/compiled/python2.4/lib/python2.4/doctest.py", line 1248, in __run compileflags, 1) in test.globs File "<doctest test_response.txt[197]>", line 1, in ? raise HTTPBadRequest() TypeError: exceptions must be classes, instances, or strings (deprecated), not HTTPBadRequest

raise self.failureException(self.format_failure(<StringIO.StringIO instance at 0xb7235eec>.getvalue()))

}}}

Comments (0)

  1. Log in to comment