comply with the evilJavaNamingScheme for attribute names

It seems my love of PEP 8 overrode the need for consistentcy
This commit is contained in:
Benjamin Peterson 2009-03-23 22:29:45 +00:00
parent 692428e77f
commit cb2b0e45d4
3 changed files with 11 additions and 11 deletions

View file

@ -950,7 +950,7 @@ tools which support interactive reporting while tests are being run.
:func:`expectedFailure` decorator. :func:`expectedFailure` decorator.
The default implementation appends a tuple ``(test, formatted_err)`` to the The default implementation appends a tuple ``(test, formatted_err)`` to the
instance's ``expected_failures`` attribute, where *formatted_err* is a instance's ``expectedFailures`` attribute, where *formatted_err* is a
formatted traceback derived from *err*. formatted traceback derived from *err*.
@ -960,7 +960,7 @@ tools which support interactive reporting while tests are being run.
decorator, but succeeded. decorator, but succeeded.
The default implementation appends the test to the instance's The default implementation appends the test to the instance's
``unexpected_successes`` attribute. ``unexpectedSuccesses`` attribute.
.. _testloader-objects: .. _testloader-objects:

View file

@ -2362,7 +2362,7 @@ class Test_TestSkipping(TestCase):
test.run(result) test.run(result)
self.assertEqual(events, self.assertEqual(events,
['startTest', 'addExpectedFailure', 'stopTest']) ['startTest', 'addExpectedFailure', 'stopTest'])
self.assertEqual(result.expected_failures[0][0], test) self.assertEqual(result.expectedFailures[0][0], test)
self.assertTrue(result.wasSuccessful()) self.assertTrue(result.wasSuccessful())
def test_unexpected_success(self): def test_unexpected_success(self):
@ -2377,7 +2377,7 @@ class Test_TestSkipping(TestCase):
self.assertEqual(events, self.assertEqual(events,
['startTest', 'addUnexpectedSuccess', 'stopTest']) ['startTest', 'addUnexpectedSuccess', 'stopTest'])
self.assertFalse(result.failures) self.assertFalse(result.failures)
self.assertEqual(result.unexpected_successes, [test]) self.assertEqual(result.unexpectedSuccesses, [test])
self.assertTrue(result.wasSuccessful()) self.assertTrue(result.wasSuccessful())

View file

@ -176,8 +176,8 @@ class TestResult(object):
self.errors = [] self.errors = []
self.testsRun = 0 self.testsRun = 0
self.skipped = [] self.skipped = []
self.expected_failures = [] self.expectedFailures = []
self.unexpected_successes = [] self.unexpectedSuccesses = []
self.shouldStop = False self.shouldStop = False
def startTest(self, test): def startTest(self, test):
@ -209,12 +209,12 @@ class TestResult(object):
def addExpectedFailure(self, test, err): def addExpectedFailure(self, test, err):
"""Called when an expected failure/error occured.""" """Called when an expected failure/error occured."""
self.expected_failures.append( self.expectedFailures.append(
(test, self._exc_info_to_string(err, test))) (test, self._exc_info_to_string(err, test)))
def addUnexpectedSuccess(self, test): def addUnexpectedSuccess(self, test):
"""Called when a test was expected to fail, but succeed.""" """Called when a test was expected to fail, but succeed."""
self.unexpected_successes.append(test) self.unexpectedSuccesses.append(test)
def wasSuccessful(self): def wasSuccessful(self):
"Tells whether or not this result was a success" "Tells whether or not this result was a success"
@ -923,10 +923,10 @@ class TextTestRunner(object):
self.stream.writeln("Ran %d test%s in %.3fs" % self.stream.writeln("Ran %d test%s in %.3fs" %
(run, run != 1 and "s" or "", timeTaken)) (run, run != 1 and "s" or "", timeTaken))
self.stream.writeln() self.stream.writeln()
results = map(len, (result.expected_failures, results = map(len, (result.expectedFailures,
result.unexpected_successes, result.unexpectedSuccesses,
result.skipped)) result.skipped))
expected_fails, unexpected_successes, skipped = results expectedFails, unexpectedSuccesses, skipped = results
infos = [] infos = []
if not result.wasSuccessful(): if not result.wasSuccessful():
self.stream.write("FAILED") self.stream.write("FAILED")