Commit Graph

93 Commits

Author SHA1 Message Date
Michael Foord 94f071c715 Fix error message for comparing single line strings in unittest.TestCase.assertEqual.
Issue 9174
2010-07-10 13:51:42 +00:00
Michael Foord 33958b87f2 Fix issue with nested test suites debug method and module setups. (unittest) 2010-06-10 20:40:21 +00:00
Michael Foord ae1bb9a00c Typo correction. 2010-06-09 12:29:56 +00:00
Michael Foord 0fedb28951 Issue 8948. cleanup functions are not run by unittest.TestCase.debug(), plus class and module teardowns are not run by unittest.TestSuite.debug(). 2010-06-08 22:44:52 +00:00
Michael Foord c532c57d44 Code formatting change. 2010-06-05 23:58:40 +00:00
Michael Foord db919f0188 Tests for issue 8302, skipped test in a setUpClass or a setUpModule are reported as skips rather than errors. 2010-06-05 20:59:00 +00:00
Michael Foord c1d7c5b7fa Tests for unittest.TestCase.maxDiff. 2010-06-05 20:33:43 +00:00
Michael Foord 20e287caed Issue 8302. SkipTest exception is setUpClass or setUpModule is now reported as a skip rather than an error. 2010-06-05 19:38:42 +00:00
Michael Foord f2c25c5cb0 Fix unittest tests after previous commit. 2010-06-05 13:48:27 +00:00
Michael Foord 5fe21ff91a unittest.TestCase assertion methods inform you when they have omitted an over long diff on failure. Issue 8351. 2010-06-05 13:38:16 +00:00
Michael Foord 674648e3f2 unittest.TestCase.assertDictEqual and assertMultilineEqual provide better default failure messages in the event of long diffs. 2010-06-05 12:58:39 +00:00
Michael Foord e37d75fce2 Removed the new max_diff argument to assertSequenceEqual. All unittest.TestCase assert methods that use difflib to produce failure messages now truncate overly long messages. New class attribute unittest.TestCase.maxDiff to configure this if necessary. Issue 8351. 2010-06-05 12:10:52 +00:00
Michael Foord a441287f79 Extract error message truncating into a method (unittest.TestCase._truncateMessage). 2010-06-05 11:46:59 +00:00
Michael Foord 0100702b9a Issue 8351. Suppress large diffs in unittest.TestCase.assertSequenceEqual. 2010-06-05 11:23:51 +00:00
Michael Foord 9ef5d33084 unittest TestLoader test discovery filename matching done in a method. This makes it easier to override the matching strategy in subclasses. No behaviour change in actual implementation. 2010-06-05 10:39:42 +00:00
Michael Foord 72b1977221 Improving help message for python -m unittest. Issue 8303. 2010-05-10 20:21:16 +00:00
Michael Foord 53a92eb3c3 Adding a test for unittest.BaseTestSuite. 2010-05-09 09:58:25 +00:00
Michael Foord 9c164af6c3 unittest: issue 8301. Adding functions to test suites no longer crashes. 2010-05-08 17:06:25 +00:00
Michael Foord 959c16d7a4 Updating documentation and adding docstrings to unittest.TestCase.assertRegexpMatches and assertNotRegexpMatches. Issue 8038. 2010-05-08 16:40:52 +00:00
Michael Foord 22097e4e66 Issue 7780. Adding a test for unittest test discovery from a dotted path. 2010-05-08 13:20:07 +00:00
Michael Foord e6f5e22123 Issue 8547 - detecting and reporting that modules have been imported from the wrong location under test discovery. 2010-05-07 23:39:38 +00:00
Benjamin Peterson 1a0ce685ab revert r80932; it breaks windows 2010-05-07 20:45:07 +00:00
Michael Foord ae4dde0858 Issue 8547 - detecting and reporting that modules have been imported from the wrong location under test discovery. 2010-05-07 18:16:19 +00:00
Michael Foord 4fedbce55a Adding tests for unittest command line handling of buffer, catchbreak and failfast. 2010-05-07 15:52:05 +00:00
Michael Foord 215d394b82 Adding a test for unittest test discovery with dotted path name. 2010-05-07 15:34:08 +00:00
Michael Foord f9ffccea56 Fix unittest tests to not abuse traceback.format_exception 2010-05-02 20:39:42 +00:00
Michael Foord 5c322ece96 Adding unittest.removeHandler function / decorator for removing the signal.SIGINT signal handler. With tests and docs. 2010-04-25 19:02:46 +00:00
R. David Murray fb4812fb59 Issue #8263: On freebsd6 the unittest 'break' test stops regrtest; skip it.
This is presumably related to issue 3864, and appears to be due
to a platform bug on freebsd6.
2010-04-17 21:59:26 +00:00
Michael Foord f6ff26c486 unittest.result.TestResult does not create its buffers until they're used. It uses StringIO not cStringIO. Issue 8333. 2010-04-07 23:04:22 +00:00
Michael Foord c1bf677e28 Fix module directory finding logic for dotted paths in unittest test discovery. 2010-04-06 23:18:16 +00:00
Raymond Hettinger bb006cf26c Add tests for cmp_to_key.
Adopt PEP 8 compliant function name.
Factor-out existing uses cmp_to_key.
Update documentation to use internal pointers instead of external resource.
2010-04-04 21:45:01 +00:00
Michael Foord 3dd9f40d6d Minor tweak to unittest command line usage message 2010-04-03 15:20:00 +00:00
Michael Foord d43b63fed3 Adding -b command line option to the unittest usage message. 2010-04-03 14:52:18 +00:00
Michael Foord 93232660bb Another attempt at a fix for unittest.test.test_result for windows line endings 2010-04-03 02:33:55 +00:00
Michael Foord 9b4ee12e89 Cross platform unittest.TestResult newline handling when buffering stdout / stderr. 2010-04-03 02:21:39 +00:00
Michael Foord 931190b4f5 Support dotted module names for test discovery paths in unittest. Issue 7780. 2010-04-03 01:15:21 +00:00
Brian Curtin e5aa886b44 Implement #1220212. Add os.kill support for Windows.
os.kill takes one of two newly added signals, CTRL_C_EVENT and
CTRL_BREAK_EVENT, or any integer value. The events are a special case
which work with subprocess console applications which implement a
special console control handler. Any other value but those two will
cause os.kill to use TerminateProcess, outright killing the process.

This change adds win_console_handler.py, which is a script to implement
SetConsoleCtrlHandler and applicable handler function, using ctypes.

subprocess also gets another attribute which is a necessary flag to
creationflags in Popen in order to send the CTRL events.
2010-04-02 23:26:06 +00:00
Michael Foord a04c7a0f16 Issue #8038: Addition of unittest.TestCase.assertNotRegexpMatches 2010-04-02 22:55:59 +00:00
Michael Foord 25d7976014 unittest tests no longer replace the sys.stdout put in place by regrtest 2010-04-02 22:30:56 +00:00
Michael Foord 58c1e78806 TestResult stores original sys.stdout and tests no longer use sys.__stdout__ (etc) in tests for unittest -b command line option 2010-04-02 22:08:29 +00:00
Michael Foord 5637f04a94 Addition of -b command line option to unittest for buffering stdout and stderr during test runs. 2010-04-02 21:42:47 +00:00
Michael Foord e6410c536c Backport of weakref.WeakSet and tests from Python 3. 2010-03-29 20:04:23 +00:00
Michael Foord a7e08fe3f8 Addition of delta keyword argument to unittest.TestCase.assertAlmostEquals and assertNotAlmostEquals
This allows the comparison of objects by specifying a maximum difference; this includes the comparing of non-numeric objects that don't support rounding.
2010-03-27 19:10:11 +00:00
Michael Foord b35ecf4775 Rename the unittest test_suite function to not clash with a test module name (unittest.test.test_suite is now unambiguous). 2010-03-27 13:42:34 +00:00
Michael Foord ff889396a8 A fix for running unittest tests on platforms without the audioop module (e.g. jython and IronPython) 2010-03-27 12:55:19 +00:00
Michael Foord fa2f1cdcbb Addition of -c command line option to unittest, to handle ctrl-c during a test run more elegantly 2010-03-26 03:18:31 +00:00
Michael Foord ee627883a7 Move a support TestCase out of the main namespace in unittest.test.test_suite 2010-03-26 02:53:56 +00:00
Michael Foord 95ac82bfc6 Remove incorrect docstring in unittest.test 2010-03-26 00:03:38 +00:00
Michael Foord 35b3792ed3 Turn unittest tests into a package 2010-03-25 23:56:33 +00:00
Michael Foord eef159bd17 Correct usage message displayed for python -m unittest -h 2010-03-22 02:49:08 +00:00