All Samples(745) | Call(622) | Derive(110) | Import(13)
Holder for test result information. Test results are automatically managed by the TestCase and TestSuite classes, and do not need to be explicitly manipulated by writers of tests. Each instance holds the total number of tests run, and collections of failures and errors that occurred among those test runs. The collections contain tuples of (testcase, exceptioninfo), where exceptioninfo is the formatted traceback of the error that occurred.
src/p/e/peckcheck-HEAD/peckcheck.py peckcheck(Download)
# We import these remaining names so peckcheck can serve as a drop-in
# replacement for the unittest module.
from unittest import TestResult, TestSuite, FunctionTestCase
if __name__ == '__main__':
main(module=None)
src/m/d/mdn-lib-HEAD/packages/nose/unit_tests/test_tools.py mdn-lib(Download)
def test_multiple_with_setup(self):
from nose.tools import with_setup
from nose.case import FunctionTestCase
from unittest import TestResult
called = []
def test():
ws1 = with_setup(s1, t1)(test)
case1 = FunctionTestCase(ws1)
case1(TestResult())
self.assertEqual(called, ['s1', 'test', 't1'])
called[:] = []
ws2 = with_setup(s2, t2)(test2)
ws2 = with_setup(s1, t1)(ws2)
case2 = FunctionTestCase(ws2)
case2(TestResult())
ws3 = with_setup(s2, t2)(ws3)
ws3 = with_setup(s1, t1)(ws3)
case3 = FunctionTestCase(ws3)
case3(TestResult())
self.assertEqual(called, ['s1', 's2', 's3',
'test3', 't3', 't2', 't1'])
src/p/y/python-nose-HEAD/unit_tests/test_tools.py python-nose(Download)
def test_multiple_with_setup(self):
from nose.tools import with_setup
from nose.case import FunctionTestCase
from unittest import TestResult
called = []
def test():
ws1 = with_setup(s1, t1)(test)
case1 = FunctionTestCase(ws1)
case1(TestResult())
self.assertEqual(called, ['s1', 'test', 't1'])
called[:] = []
ws2 = with_setup(s2, t2)(test2)
ws2 = with_setup(s1, t1)(ws2)
case2 = FunctionTestCase(ws2)
case2(TestResult())
ws3 = with_setup(s2, t2)(ws3)
ws3 = with_setup(s1, t1)(ws3)
case3 = FunctionTestCase(ws3)
case3(TestResult())
self.assertEqual(called, ['s1', 's2', 's3',
'test3', 't3', 't2', 't1'])
src/s/e/secret-squirrel-lib-HEAD/packages/nose/unit_tests/test_tools.py secret-squirrel-lib(Download)
def test_multiple_with_setup(self):
from nose.tools import with_setup
from nose.case import FunctionTestCase
from unittest import TestResult
called = []
def test():
ws1 = with_setup(s1, t1)(test)
case1 = FunctionTestCase(ws1)
case1(TestResult())
self.assertEqual(called, ['s1', 'test', 't1'])
called[:] = []
ws2 = with_setup(s2, t2)(test2)
ws2 = with_setup(s1, t1)(ws2)
case2 = FunctionTestCase(ws2)
case2(TestResult())
ws3 = with_setup(s2, t2)(ws3)
ws3 = with_setup(s1, t1)(ws3)
case3 = FunctionTestCase(ws3)
case3(TestResult())
self.assertEqual(called, ['s1', 's2', 's3',
'test3', 't3', 't2', 't1'])
src/b/a/badger-lib-HEAD/packages/nose/unit_tests/test_tools.py badger-lib(Download)
def test_multiple_with_setup(self):
from nose.tools import with_setup
from nose.case import FunctionTestCase
from unittest import TestResult
called = []
def test():
ws1 = with_setup(s1, t1)(test)
case1 = FunctionTestCase(ws1)
case1(TestResult())
self.assertEqual(called, ['s1', 'test', 't1'])
called[:] = []
ws2 = with_setup(s2, t2)(test2)
ws2 = with_setup(s1, t1)(ws2)
case2 = FunctionTestCase(ws2)
case2(TestResult())
ws3 = with_setup(s2, t2)(ws3)
ws3 = with_setup(s1, t1)(ws3)
case3 = FunctionTestCase(ws3)
case3(TestResult())
self.assertEqual(called, ['s1', 's2', 's3',
'test3', 't3', 't2', 't1'])
src/u/n/unittest-xml-reporting-1.0.3/src/xmlrunner/__init__.py unittest-xml-reporting(Download)
import os import sys import time from unittest import TestResult, _TextTestResult, TextTestRunner from cStringIO import StringIO
src/t/e/testresources-0.2.4/lib/testresources/tests/__init__.py testresources(Download)
# license. # from unittest import TestResult import testresources from testresources.tests import TestUtil
class ResultWithResourceExtensions(TestResult):
"""A test fake which has resource extensions."""
def __init__(self):
TestResult.__init__(self)
self._calls = []
src/t/e/teamcity-messages-1.4/teamcity/unittestpy.py teamcity-messages(Download)
import traceback, types, sys, os from unittest import TestResult from teamcity.messages import TeamcityServiceMessages # Added *k to some methods to get compatibility with nosetests class TeamcityTestResult(TestResult):
src/n/o/nose-0.11.4/unit_tests/test_tools.py nose(Download)
def test_multiple_with_setup(self):
from nose.tools import with_setup
from nose.case import FunctionTestCase
from unittest import TestResult
called = []
def test():
ws1 = with_setup(s1, t1)(test)
case1 = FunctionTestCase(ws1)
case1(TestResult())
self.assertEqual(called, ['s1', 'test', 't1'])
called[:] = []
ws2 = with_setup(s2, t2)(test2)
ws2 = with_setup(s1, t1)(ws2)
case2 = FunctionTestCase(ws2)
case2(TestResult())
ws3 = with_setup(s2, t2)(ws3)
ws3 = with_setup(s1, t1)(ws3)
case3 = FunctionTestCase(ws3)
case3(TestResult())
self.assertEqual(called, ['s1', 's2', 's3',
'test3', 't3', 't2', 't1'])
src/n/e/Nevow-0.10.0/nevow/test/test_testutil.py Nevow(Download)
"""
Tests for L{nevow.testutil} -- a module of utilities for testing Nevow
applications.
"""
from unittest import TestResult
def test_unsuccessfulExit(self):
"""
Verify that an unsuccessful exit status results in an error.
"""
result = TestResult()
self.case.createSource = lambda testMethod: "throw new TypeError();"
self.case.run(result)
return FilePath(__file__).sibling('segfault.py').path
self.case.findJavascriptInterpreter = stubFinder
self.case.createSource = lambda testMethod: ""
result = TestResult()
self.case.run(result)
self.assertEqual(len(result.errors), 1)
def test_missingJavaScriptClass(self):
"""
If a JavaScript class required by the test code is unavailable, an
error is added to the result object by L{JavaScriptTestCase.run}.
"""
result = TestResult()
1 | 2 Next