Make text_content more explicit about the types that it accepts.
[third_party/testtools] / NEWS
1 testtools NEWS
2 ++++++++++++++
3
4 Changes and improvements to testtools_, grouped by release.
5
6
7 NEXT
8 ~~~~
9
10 Changes
11 -------
12
13 * Fixed unit tests which were failing under pypy due to a change in the way
14   pypy formats tracebacks. (Thomi Richards)
15
16 * Make `testtools.content.text_content` error if anything other than text
17   is given as content. (Thomi Richards)
18
19 1.1.0
20 ~~~~~
21
22 Improvements
23 ------------
24
25 * Exceptions in a ``fixture.getDetails`` method will no longer mask errors
26   raised from the same fixture's ``setUp`` method.
27   (Robert Collins, #1368440)
28
29 1.0.0
30 ~~~~~
31
32 Long overdue, we've adopted a backwards compatibility statement and recognized
33 that we have plenty of users depending on our behaviour - calling our version
34 1.0.0 is a recognition of that.
35
36 Improvements
37 ------------
38
39 * Fix a long-standing bug where tearDown and cleanUps would not be called if the
40   test run was interrupted. This should fix leaking external resources from
41   interrupted tests.
42   (Robert Collins, #1364188)
43
44 * Fix a long-standing bug where calling sys.exit(0) from within a test would
45   cause the test suite to exit with 0, without reporting a failure of that
46   test. We still allow the test suite to be exited (since catching higher order
47   exceptions requires exceptional circumstances) but we now call a last-resort
48   handler on the TestCase, resulting in an error being reported for the test.
49   (Robert Collins, #1364188)
50
51 * Fix an issue where tests skipped with the ``skip``* family of decorators would
52   still have their ``setUp`` and ``tearDown`` functions called.
53   (Thomi Richards, #https://github.com/testing-cabal/testtools/issues/86)
54
55 * We have adopted a formal backwards compatibility statement (see hacking.rst)
56   (Robert Collins)
57
58 0.9.39
59 ~~~~~~
60
61 Brown paper bag release - 0.9.38 was broken for some users,
62 _jython_aware_splitext was not defined entirely compatibly.
63 (Robert Collins, #https://github.com/testing-cabal/testtools/issues/100)
64
65 0.9.38
66 ~~~~~~
67
68 Bug fixes for test importing.
69
70 Improvements
71 ------------
72
73 * Discovery import error detection wasn't implemented for python 2.6 (the
74   'discover' module). (Robert Collins)
75
76 * Discovery now executes load_tests (if present) in __init__ in all packages.
77   (Robert Collins, http://bugs.python.org/issue16662)
78
79 0.9.37
80 ~~~~~~
81
82 Minor improvements to correctness.
83
84 Changes
85 -------
86
87 * ``stdout`` is now correctly honoured on ``run.TestProgram`` - before the
88   runner objects would be created with no stdout parameter. If construction
89   fails, the previous parameter list is attempted, permitting compatibility
90   with Runner classes that don't accept stdout as a parameter.
91   (Robert Collins)
92
93 * The ``ExtendedToStreamDecorator`` now handles content objects with one less
94   packet - the last packet of the source content is sent with EOF set rather
95   than an empty packet with EOF set being sent after the last packet of the
96   source content. (Robert Collins)
97
98 0.9.36
99 ~~~~~~
100
101 Welcome to our long overdue 0.9.36 release, which improves compatibility with
102 Python3.4, adds assert_that, a function for using matchers without TestCase
103 objects, and finally will error if you try to use setUp or tearDown twice -
104 since that invariably leads to bad things of one sort or another happening.
105
106 Changes
107 -------
108
109 * Error if ``setUp`` or ``tearDown`` are called twice.
110   (Robert Collins, #882884)
111
112 * Make testtools compatible with the ``unittest.expectedFailure`` decorator in
113   Python 3.4. (Thomi Richards)
114
115
116 Improvements
117 ------------
118
119 * Introduce the assert_that function, which allows matchers to be used
120   independent of testtools.TestCase. (Daniel Watkins, #1243834)
121
122
123 0.9.35
124 ~~~~~~
125
126 Changes
127 -------
128
129 * Removed a number of code paths where Python 2.4 and Python 2.5 were
130   explicitly handled. (Daniel Watkins)
131
132 Improvements
133 ------------
134
135 * Added the ``testtools.TestCase.expectThat`` method, which implements
136   delayed assertions. (Thomi Richards)
137
138 * Docs are now built as part of the Travis-CI build, reducing the chance of
139   Read The Docs being broken accidentally. (Daniel Watkins, #1158773)
140
141 0.9.34
142 ~~~~~~
143
144 Improvements
145 ------------
146
147 * Added ability for ``testtools.TestCase`` instances to force a test to
148   fail, even if no assertions failed. (Thomi Richards)
149
150 * Added ``testtools.content.StacktraceContent``, a content object that
151   automatically creates a ``StackLinesContent`` object containing the current
152   stack trace. (Thomi Richards)
153
154 * ``AnyMatch`` is now exported properly in ``testtools.matchers``.
155   (Robert Collins, Rob Kennedy, github #44)
156
157 * In Python 3.3, if there are duplicate test ids, tests.sort() will
158   fail and raise TypeError. Detect the duplicate test ids firstly in
159   sorted_tests() to ensure that all test ids are unique.
160   (Kui Shi, #1243922)
161
162 * ``json_content`` is now in the ``__all__`` attribute for
163   ``testtools.content``. (Robert Collins)
164
165 * Network tests now bind to 127.0.0.1 to avoid (even temporary) network
166   visible ports. (Benedikt Morbach, github #46)
167
168 * Test listing now explicitly indicates by printing 'Failed to import' and
169   exiting (2) when an import has failed rather than only signalling through the
170   test name. (Robert Collins, #1245672)
171
172 * ``test_compat.TestDetectEncoding.test_bom`` now works on Python 3.3 - the
173   corner case with euc_jp is no longer permitted in Python 3.3 so we can
174   skip it. (Martin [gz], #1251962)
175
176 0.9.33
177 ~~~~~~
178
179 Improvements
180 ------------
181
182 * Added ``addDetailuniqueName`` method to ``testtools.TestCase`` class.
183   (Thomi Richards)
184
185 * Removed some unused code from ``testtools.content.TracebackContent``.
186   (Thomi Richards)
187
188 * Added ``testtools.StackLinesContent``: a content object for displaying
189   pre-processed stack lines. (Thomi Richards)
190
191 * ``StreamSummary`` was calculating testsRun incorrectly: ``exists`` status
192   tests were counted as run tests, but they are not.
193   (Robert Collins, #1203728)
194
195 0.9.32
196 ~~~~~~
197
198 Regular maintenance release.  Special thanks to new contributor, Xiao Hanyu!
199
200 Changes
201 -------
202
203  * ``testttols.compat._format_exc_info`` has been refactored into several
204    smaller functions. (Thomi Richards)
205
206 Improvements
207 ------------
208
209 * Stacktrace filtering no longer hides unittest frames that are surrounded by
210   user frames. We will reenable this when we figure out a better algorithm for
211   retaining meaning. (Robert Collins, #1188420)
212
213 * The compatibility code for skipped tests with unittest2 was broken.
214   (Robert Collins, #1190951)
215
216 * Various documentation improvements (Clint Byrum, Xiao Hanyu).
217
218 0.9.31
219 ~~~~~~
220
221 Improvements
222 ------------
223
224 * ``ExpectedException`` now accepts a msg parameter for describing an error,
225   much the same as assertEquals etc. (Robert Collins)
226
227 0.9.30
228 ~~~~~~
229
230 A new sort of TestResult, the StreamResult has been added, as a prototype for
231 a revised standard library test result API.  Expect this API to change.
232 Although we will try to preserve compatibility for early adopters, it is
233 experimental and we might need to break it if it turns out to be unsuitable.
234
235 Improvements
236 ------------
237 * ``assertRaises`` works properly for exception classes that have custom 
238   metaclasses
239
240 * ``ConcurrentTestSuite`` was silently eating exceptions that propagate from
241   the test.run(result) method call. Ignoring them is fine in a normal test
242   runner, but when they happen in a different thread, the thread that called
243   suite.run() is not in the stack anymore, and the exceptions are lost. We now
244   create a synthetic test recording any such exception.
245   (Robert Collins, #1130429)
246
247 * Fixed SyntaxError raised in ``_compat2x.py`` when installing via Python 3.
248   (Will Bond, #941958)
249
250 * New class ``StreamResult`` which defines the API for the new result type.
251   (Robert Collins)
252
253 * New support class ``ConcurrentStreamTestSuite`` for convenient construction
254   and utilisation of ``StreamToQueue`` objects. (Robert Collins)
255
256 * New support class ``CopyStreamResult`` which forwards events onto multiple
257   ``StreamResult`` objects (each of which receives all the events).
258   (Robert Collins)
259
260 * New support class ``StreamSummary`` which summarises a ``StreamResult``
261   stream compatibly with ``TestResult`` code. (Robert Collins)
262
263 * New support class ``StreamTagger`` which adds or removes tags from
264   ``StreamResult`` events. (RobertCollins)
265
266 * New support class ``StreamToDict`` which converts a ``StreamResult`` to a
267   series of dicts describing a test. Useful for writing trivial stream
268   analysers. (Robert Collins)
269
270 * New support class ``TestControl`` which permits cancelling an in-progress
271   run. (Robert Collins)
272
273 * New support class ``StreamFailFast`` which calls a ``TestControl`` instance
274   to abort the test run when a failure is detected. (Robert Collins)
275
276 * New support class ``ExtendedToStreamDecorator`` which translates both regular
277   unittest TestResult API calls and the ExtendedTestResult API which testtools
278   has supported into the StreamResult API. ExtendedToStreamDecorator also
279   forwards calls made in the StreamResult API, permitting it to be used
280   anywhere a StreamResult is used. Key TestResult query methods like
281   wasSuccessful and shouldStop are synchronised with the StreamResult API
282   calls, but the detailed statistics like the list of errors are not - a
283   separate consumer will be created to support that.
284   (Robert Collins)
285
286 * New support class ``StreamToExtendedDecorator`` which translates
287   ``StreamResult`` API calls into ``ExtendedTestResult`` (or any older
288   ``TestResult``) calls. This permits using un-migrated result objects with
289   new runners / tests. (Robert Collins)
290
291 * New support class ``StreamToQueue`` for sending messages to one
292   ``StreamResult`` from multiple threads. (Robert Collins)
293
294 * New support class ``TimestampingStreamResult`` which adds a timestamp to
295   events with no timestamp. (Robert Collins)
296
297 * New ``TestCase`` decorator ``DecorateTestCaseResult`` that adapts the
298   ``TestResult`` or ``StreamResult`` a case will be run with, for ensuring that
299   a particular result object is used even if the runner running the test doesn't
300   know to use it. (Robert Collins)
301
302 * New test support class ``testtools.testresult.doubles.StreamResult``, which
303   captures all the StreamResult events. (Robert Collins)
304
305 * ``PlaceHolder`` can now hold tags, and applies them before, and removes them
306   after, the test. (Robert Collins)
307
308 * ``PlaceHolder`` can now hold timestamps, and applies them before the test and
309   then before the outcome. (Robert Collins)
310
311 * ``StreamResultRouter`` added. This is useful for demultiplexing - e.g. for
312   partitioning analysis of events or sending feedback encapsulated in
313   StreamResult events back to their source. (Robert Collins)
314
315 * ``testtools.run.TestProgram`` now supports the ``TestRunner`` taking over
316   responsibility for formatting the output of ``--list-tests``.
317   (Robert Collins)
318
319 * The error message for setUp and tearDown upcall errors was broken on Python
320   3.4. (Monty Taylor, Robert Collins, #1140688)
321
322 * The repr of object() on pypy includes the object id, which was breaking a
323   test that accidentally depended on the CPython repr for object().
324   (Jonathan Lange)
325
326 0.9.29
327 ~~~~~~
328
329 A simple bug fix, and better error messages when you don't up-call.
330
331 Changes
332 -------
333
334 * ``testtools.content_type.ContentType`` incorrectly used ',' rather than ';'
335   to separate parameters. (Robert Collins)
336
337 Improvements
338 ------------
339
340 * ``testtools.compat.unicode_output_stream`` was wrapping a stream encoder
341   around ``io.StringIO`` and ``io.TextIOWrapper`` objects, which was incorrect.
342   (Robert Collins)
343
344 * Report the name of the source file for setUp and tearDown upcall errors.
345   (Monty Taylor)
346
347 0.9.28
348 ~~~~~~
349
350 Testtools has moved VCS - https://github.com/testing-cabal/testtools/ is
351 the new home. Bug tracking is still on Launchpad, and releases are on Pypi.
352
353 We made this change to take advantage of the richer ecosystem of tools around
354 Git, and to lower the barrier for new contributors.
355
356 Improvements
357 ------------
358
359 * New ``testtools.testcase.attr`` and ``testtools.testcase.WithAttributes``
360   helpers allow marking up test case methods with simple labels. This permits
361   filtering tests with more granularity than organising them into modules and
362   test classes. (Robert Collins)
363
364 0.9.27
365 ~~~~~~
366
367 Improvements
368 ------------
369
370 * New matcher ``HasLength`` for matching the length of a collection.
371   (Robert Collins)
372
373 * New matcher ``MatchesPredicateWithParams`` make it still easier to create
374   ad hoc matchers. (Robert Collins)
375
376 * We have a simpler release process in future - see doc/hacking.rst.
377   (Robert Collins)
378
379 0.9.26
380 ~~~~~~
381
382 Brown paper bag fix: failed to document the need for setup to be able to use
383 extras. Compounded by pip not supporting setup_requires.
384
385 Changes
386 -------
387
388 * setup.py now can generate egg_info even if extras is not available.
389   Also lists extras in setup_requires for easy_install.
390   (Robert Collins, #1102464)
391
392 0.9.25
393 ~~~~~~
394
395 Changes
396 -------
397
398 * ``python -m testtools.run --load-list`` will now preserve any custom suites
399   (such as ``testtools.FixtureSuite`` or ``testresources.OptimisingTestSuite``)
400   rather than flattening them.
401   (Robert Collins, #827175)
402
403 * Testtools now depends on extras, a small library split out from it to contain
404   generally useful non-testing facilities. Since extras has been around for a
405   couple of testtools releases now, we're making this into a hard dependency of
406   testtools. (Robert Collins)
407
408 * Testtools now uses setuptools rather than distutils so that we can document
409   the extras dependency. (Robert Collins)
410
411 Improvements
412 ------------
413
414 * Testtools will no longer override test code registered details called
415   'traceback' when reporting caught exceptions from test code.
416   (Robert Collins, #812793)
417
418 0.9.24
419 ~~~~~~
420
421 Changes
422 -------
423
424 * ``testtools.run discover`` will now sort the tests it discovered. This is a 
425   workaround for http://bugs.python.org/issue16709. Non-standard test suites
426   are preserved, and their ``sort_tests()`` method called (if they have such an
427   attribute). ``testtools.testsuite.sorted_tests(suite, True)`` can be used by
428   such suites to do a local sort. (Robert Collins, #1091512)
429
430 * ``ThreadsafeForwardingResult`` now defines a stub ``progress`` method, which
431   fixes ``testr run`` of streams containing progress markers (by discarding the 
432   progress data). (Robert Collins, #1019165)
433
434 0.9.23
435 ~~~~~~
436
437 Changes
438 -------
439
440 * ``run.TestToolsTestRunner`` now accepts the verbosity, buffer and failfast
441   arguments the upstream python TestProgram code wants to give it, making it
442   possible to support them in a compatible fashion. (Robert Collins)
443
444 Improvements
445 ------------
446
447 * ``testtools.run`` now supports the ``-f`` or ``--failfast`` parameter.
448   Previously it was advertised in the help but ignored.
449   (Robert Collins, #1090582)
450
451 * ``AnyMatch`` added, a new matcher that matches when any item in a collection
452   matches the given matcher.  (Jonathan Lange)
453
454 * Spelling corrections to documentation.  (Vincent Ladeuil)
455
456 * ``TestProgram`` now has a sane default for its ``testRunner`` argument.
457   (Vincent Ladeuil)
458
459 * The test suite passes on Python 3 again. (Robert Collins)
460
461 0.9.22
462 ~~~~~~
463
464 Improvements
465 ------------
466
467 * ``content_from_file`` and ``content_from_stream`` now accept seek_offset and
468   seek_whence parameters allowing them to be used to grab less than the full
469   stream, or to be used with StringIO streams. (Robert Collins, #1088693)
470
471 0.9.21
472 ~~~~~~
473
474 Improvements
475 ------------
476
477 * ``DirContains`` correctly exposed, after being accidentally hidden in the
478   great matcher re-organization of 0.9.17.  (Jonathan Lange)
479
480
481 0.9.20
482 ~~~~~~
483
484 Three new matchers that'll rock your world.
485
486 Improvements
487 ------------
488
489 * New, powerful matchers that match items in a dictionary:
490
491   - ``MatchesDict``, match every key in a dictionary with a key in a
492     dictionary of matchers.  For when the set of expected keys is equal to the
493     set of observed keys.
494
495   - ``ContainsDict``, every key in a dictionary of matchers must be
496     found in a dictionary, and the values for those keys must match.  For when
497     the set of expected keys is a subset of the set of observed keys.
498
499   - ``ContainedByDict``, every key in a dictionary must be found in
500     a dictionary of matchers.  For when the set of expected keys is a superset
501     of the set of observed keys.
502
503   The names are a little confusing, sorry.  We're still trying to figure out
504   how to present the concept in the simplest way possible.
505
506
507 0.9.19
508 ~~~~~~
509
510 How embarrassing!  Three releases in two days.
511
512 We've worked out the kinks and have confirmation from our downstreams that
513 this is all good.  Should be the last release for a little while.  Please
514 ignore 0.9.18 and 0.9.17.
515
516 Improvements
517 ------------
518
519 * Include the matcher tests in the release, allowing the tests to run and
520   pass from the release tarball.  (Jonathan Lange)
521
522 * Fix cosmetic test failures in Python 3.3, introduced during release 0.9.17.
523   (Jonathan Lange)
524
525
526 0.9.18
527 ~~~~~~
528
529 Due to an oversight, release 0.9.18 did not contain the new
530 ``testtools.matchers`` package and was thus completely broken.  This release
531 corrects that, returning us all to normality.
532
533 0.9.17
534 ~~~~~~
535
536 This release brings better discover support and Python3.x improvements. There
537 are still some test failures on Python3.3 but they are cosmetic - the library
538 is as usable there as on any other Python 3 release.
539
540 Changes
541 -------
542
543 * The ``testtools.matchers`` package has been split up.  No change to the
544   public interface.  (Jonathan Lange)
545
546 Improvements
547 ------------
548
549 * ``python -m testtools.run discover . --list`` now works. (Robert Collins)
550
551 * Correctly handling of bytes vs text in JSON content type. (Martin [gz])
552
553
554 0.9.16
555 ~~~~~~
556
557 Some new matchers and a new content helper for JSON content.
558
559 This is the first release of testtools to drop support for Python 2.4 and 2.5.
560 If you need support for either of those versions, please use testtools 0.9.15.
561
562 Improvements
563 ------------
564
565 * New content helper, ``json_content`` (Jonathan Lange)
566
567 * New matchers:
568
569   * ``ContainsAll`` for asserting one thing is a subset of another
570     (Raphaël Badin)
571
572   * ``SameMembers`` for asserting two iterators have the same members.
573     (Jonathan Lange)
574
575 * Reraising of exceptions in Python 3 is more reliable. (Martin [gz])
576
577
578 0.9.15
579 ~~~~~~
580
581 This is the last release to support Python2.4 and 2.5. It brings in a slew of
582 improvements to test tagging and concurrency, making running large test suites
583 with partitioned workers more reliable and easier to reproduce exact test
584 ordering in a given worker. See our sister project ``testrepository`` for a
585 test runner that uses these features.
586
587 Changes
588 -------
589
590 * ``PlaceHolder`` and ``ErrorHolder`` now support being given result details.
591   (Robert Collins)
592
593 * ``ErrorHolder`` is now just a function - all the logic is in ``PlaceHolder``.
594   (Robert Collins)
595
596 * ``TestResult`` and all other ``TestResult``-like objects in testtools
597   distinguish between global tags and test-local tags, as per the subunit
598   specification.  (Jonathan Lange)
599
600 * This is the **last** release of testtools that supports Python 2.4 or 2.5.
601   These releases are no longer supported by the Python community and do not
602   receive security updates. If this affects you, you will need to either
603   stay on this release or perform your own backports.
604   (Jonathan Lange, Robert Collins)
605
606 * ``ThreadsafeForwardingResult`` now forwards global tags as test-local tags,
607   making reasoning about the correctness of the multiplexed stream simpler.
608   This preserves the semantic value (what tags apply to a given test) while
609   consuming less stream size (as no negative-tag statement is needed).
610   (Robert Collins, Gary Poster, #986434)
611
612 Improvements
613 ------------
614
615 * API documentation corrections. (Raphaël Badin)
616
617 * ``ConcurrentTestSuite`` now takes an optional ``wrap_result`` parameter
618   that can be used to wrap the ``ThreadsafeForwardingResults`` created by
619   the suite.  (Jonathan Lange)
620
621 * ``Tagger`` added.  It's a new ``TestResult`` that tags all tests sent to
622   it with a particular set of tags.  (Jonathan Lange)
623
624 * ``testresultdecorator`` brought over from subunit.  (Jonathan Lange)
625
626 * All ``TestResult`` wrappers now correctly forward ``current_tags`` from
627   their wrapped results, meaning that ``current_tags`` can always be relied
628   upon to return the currently active tags on a test result.
629
630 * ``TestByTestResult``, a ``TestResult`` that calls a method once per test,
631   added.  (Jonathan Lange)
632
633 * ``ThreadsafeForwardingResult`` correctly forwards ``tags()`` calls where
634   only one of ``new_tags`` or ``gone_tags`` are specified.
635   (Jonathan Lange, #980263)
636
637 * ``ThreadsafeForwardingResult`` no longer leaks local tags from one test
638   into all future tests run.  (Jonathan Lange, #985613)
639
640 * ``ThreadsafeForwardingResult`` has many, many more tests.  (Jonathan Lange)
641
642
643 0.9.14
644 ~~~~~~
645
646 Our sister project, `subunit <https://launchpad.net/subunit>`_, was using a
647 private API that was deleted in the 0.9.13 release.  This release restores
648 that API in order to smooth out the upgrade path.
649
650 If you don't use subunit, then this release won't matter very much to you.
651
652
653 0.9.13
654 ~~~~~~
655
656 Plenty of new matchers and quite a few critical bug fixes (especially to do
657 with stack traces from failed assertions).  A net win for all.
658
659 Changes
660 -------
661
662 * ``MatchesAll`` now takes an ``first_only`` keyword argument that changes how
663   mismatches are displayed.  If you were previously passing matchers to
664   ``MatchesAll`` with keyword arguments, then this change might affect your
665   test results.  (Jonathan Lange)
666
667 Improvements
668 ------------
669
670 * Actually hide all of the testtools stack for assertion failures. The
671   previous release promised clean stack, but now we actually provide it.
672   (Jonathan Lange, #854769)
673
674 * ``assertRaises`` now includes the ``repr`` of the callable that failed to raise
675   properly. (Jonathan Lange, #881052)
676
677 * Asynchronous tests no longer hang when run with trial.
678   (Jonathan Lange, #926189)
679
680 * ``Content`` objects now have an ``as_text`` method to convert their contents
681   to Unicode text.  (Jonathan Lange)
682
683 * Failed equality assertions now line up. (Jonathan Lange, #879339)
684
685 * ``FullStackRunTest`` no longer aborts the test run if a test raises an
686   error.  (Jonathan Lange)
687
688 * ``MatchesAll`` and ``MatchesListwise`` both take a ``first_only`` keyword
689   argument.  If True, they will report only on the first mismatch they find,
690   and not continue looking for other possible mismatches.
691   (Jonathan Lange)
692
693 * New helper, ``Nullary`` that turns callables with arguments into ones that
694   don't take arguments.  (Jonathan Lange)
695
696 * New matchers:
697
698   * ``DirContains`` matches the contents of a directory.
699     (Jonathan Lange, James Westby)
700
701   * ``DirExists`` matches if a directory exists.
702     (Jonathan Lange, James Westby)
703
704   * ``FileContains`` matches the contents of a file.
705     (Jonathan Lange, James Westby)
706
707   * ``FileExists`` matches if a file exists.
708     (Jonathan Lange, James Westby)
709
710   * ``HasPermissions`` matches the permissions of a file.  (Jonathan Lange)
711
712   * ``MatchesPredicate`` matches if a predicate is true.  (Jonathan Lange)
713
714   * ``PathExists`` matches if a path exists.  (Jonathan Lange, James Westby)
715
716   * ``SamePath`` matches if two paths are the same.  (Jonathan Lange)
717
718   * ``TarballContains`` matches the contents of a tarball.  (Jonathan Lange)
719
720 * ``MultiTestResult`` supports the ``tags`` method.
721   (Graham Binns, Francesco Banconi, #914279)
722
723 * ``ThreadsafeForwardingResult`` supports the ``tags`` method.
724   (Graham Binns, Francesco Banconi, #914279)
725
726 * ``ThreadsafeForwardingResult`` no longer includes semaphore acquisition time
727   in the test duration (for implicitly timed test runs).
728   (Robert Collins, #914362)
729
730 0.9.12
731 ~~~~~~
732
733 This is a very big release.  We've made huge improvements on three fronts:
734  1. Test failures are way nicer and easier to read
735  2. Matchers and ``assertThat`` are much more convenient to use
736  3. Correct handling of extended unicode characters
737
738 We've trimmed off the fat from the stack trace you get when tests fail, we've
739 cut out the bits of error messages that just didn't help, we've made it easier
740 to annotate mismatch failures, to compare complex objects and to match raised
741 exceptions.
742
743 Testing code was never this fun.
744
745 Changes
746 -------
747
748 * ``AfterPreproccessing`` renamed to ``AfterPreprocessing``, which is a more
749   correct spelling.  Old name preserved for backwards compatibility, but is
750   now deprecated.  Please stop using it.
751   (Jonathan Lange, #813460)
752
753 * ``assertThat`` raises ``MismatchError`` instead of
754   ``TestCase.failureException``.  ``MismatchError`` is a subclass of
755   ``AssertionError``, so in most cases this change will not matter. However,
756   if ``self.failureException`` has been set to a non-default value, then
757   mismatches will become test errors rather than test failures.
758
759 * ``gather_details`` takes two dicts, rather than two detailed objects.
760   (Jonathan Lange, #801027)
761
762 * ``MatchesRegex`` mismatch now says "<value> does not match /<regex>/" rather
763   than "<regex> did not match <value>". The regular expression contains fewer
764   backslashes too. (Jonathan Lange, #818079)
765
766 * Tests that run with ``AsynchronousDeferredRunTest`` now have the ``reactor``
767   attribute set to the running reactor. (Jonathan Lange, #720749)
768
769 Improvements
770 ------------
771
772 * All public matchers are now in ``testtools.matchers.__all__``.
773   (Jonathan Lange, #784859)
774
775 * ``assertThat`` can actually display mismatches and matchers that contain
776   extended unicode characters. (Jonathan Lange, Martin [gz], #804127)
777
778 * ``assertThat`` output is much less verbose, displaying only what the mismatch
779   tells us to display. Old-style verbose output can be had by passing
780   ``verbose=True`` to assertThat. (Jonathan Lange, #675323, #593190)
781
782 * ``assertThat`` accepts a message which will be used to annotate the matcher.
783   This can be given as a third parameter or as a keyword parameter.
784   (Robert Collins)
785
786 * Automated the Launchpad part of the release process.
787   (Jonathan Lange, #623486)
788
789 * Correctly display non-ASCII unicode output on terminals that claim to have a
790   unicode encoding. (Martin [gz], #804122)
791
792 * ``DocTestMatches`` correctly handles unicode output from examples, rather
793   than raising an error. (Martin [gz], #764170)
794
795 * ``ErrorHolder`` and ``PlaceHolder`` added to docs. (Jonathan Lange, #816597)
796
797 * ``ExpectedException`` now matches any exception of the given type by
798   default, and also allows specifying a ``Matcher`` rather than a mere regular
799   expression. (Jonathan Lange, #791889)
800
801 * ``FixtureSuite`` added, allows test suites to run with a given fixture.
802   (Jonathan Lange)
803
804 * Hide testtools's own stack frames when displaying tracebacks, making it
805   easier for test authors to focus on their errors.
806   (Jonathan Lange, Martin [gz], #788974)
807
808 * Less boilerplate displayed in test failures and errors.
809   (Jonathan Lange, #660852)
810
811 * ``MatchesException`` now allows you to match exceptions against any matcher,
812   rather than just regular expressions.  (Jonathan Lange, #791889)
813
814 * ``MatchesException`` now permits a tuple of types rather than a single type
815   (when using the type matching mode).  (Robert Collins)
816
817 * ``MatchesStructure.byEquality`` added to make the common case of matching
818   many attributes by equality much easier.  ``MatchesStructure.byMatcher``
819   added in case folk want to match by things other than equality.
820   (Jonathan Lange)
821
822 * New convenience assertions, ``assertIsNone`` and ``assertIsNotNone``.
823   (Christian Kampka)
824
825 * New matchers:
826
827   * ``AllMatch`` matches many values against a single matcher.
828     (Jonathan Lange, #615108)
829
830   * ``Contains``. (Robert Collins)
831
832   * ``GreaterThan``. (Christian Kampka)
833
834 * New helper, ``safe_hasattr`` added. (Jonathan Lange)
835
836 * ``reraise`` added to ``testtools.compat``. (Jonathan Lange)
837
838
839 0.9.11
840 ~~~~~~
841
842 This release brings consistent use of super for better compatibility with
843 multiple inheritance, fixed Python3 support, improvements in fixture and mather
844 outputs and a compat helper for testing libraries that deal with bytestrings.
845
846 Changes
847 -------
848
849 * ``TestCase`` now uses super to call base ``unittest.TestCase`` constructor,
850   ``setUp`` and ``tearDown``. (Tim Cole, #771508)
851
852 * If, when calling ``useFixture`` an error occurs during fixture set up, we
853   still attempt to gather details from the fixture. (Gavin Panella)
854
855
856 Improvements
857 ------------
858
859 * Additional compat helper for ``BytesIO`` for libraries that build on
860   testtools and are working on Python 3 porting. (Robert Collins)
861
862 * Corrected documentation for ``MatchesStructure`` in the test authors
863   document.  (Jonathan Lange)
864
865 * ``LessThan`` error message now says something that is logically correct.
866   (Gavin Panella, #762008)
867
868 * Multiple details from a single fixture are now kept separate, rather than
869   being mooshed together. (Gavin Panella, #788182)
870
871 * Python 3 support now back in action. (Martin [gz], #688729)
872
873 * ``try_import`` and ``try_imports`` have a callback that is called whenever
874   they fail to import a module.  (Martin Pool)
875
876
877 0.9.10
878 ~~~~~~
879
880 The last release of testtools could not be easy_installed.  This is considered
881 severe enough for a re-release.
882
883 Improvements
884 ------------
885
886 * Include ``doc/`` in the source distribution, making testtools installable
887   from PyPI again (Tres Seaver, #757439)
888
889
890 0.9.9
891 ~~~~~
892
893 Many, many new matchers, vastly expanded documentation, stacks of bug fixes,
894 better unittest2 integration.  If you've ever wanted to try out testtools but
895 been afraid to do so, this is the release to try.
896
897
898 Changes
899 -------
900
901 * The timestamps generated by ``TestResult`` objects when no timing data has
902   been received are now datetime-with-timezone, which allows them to be
903   sensibly serialised and transported. (Robert Collins, #692297)
904
905 Improvements
906 ------------
907
908 * ``AnnotatedMismatch`` now correctly returns details.
909   (Jonathan Lange, #724691)
910
911 * distutils integration for the testtools test runner. Can now use it for
912   'python setup.py test'. (Christian Kampka, #693773)
913
914 * ``EndsWith`` and ``KeysEqual`` now in testtools.matchers.__all__.
915   (Jonathan Lange, #692158)
916
917 * ``MatchesException`` extended to support a regular expression check against
918   the str() of a raised exception.  (Jonathan Lange)
919
920 * ``MultiTestResult`` now forwards the ``time`` API. (Robert Collins, #692294)
921
922 * ``MultiTestResult`` now documented in the manual. (Jonathan Lange, #661116)
923
924 * New content helpers ``content_from_file``, ``content_from_stream`` and
925   ``attach_file`` make it easier to attach file-like objects to a
926   test. (Jonathan Lange, Robert Collins, #694126)
927
928 * New ``ExpectedException`` context manager to help write tests against things
929   that are expected to raise exceptions. (Aaron Bentley)
930
931 * New matchers:
932
933   * ``MatchesListwise`` matches an iterable of matchers against an iterable
934     of values. (Michael Hudson-Doyle)
935
936   * ``MatchesRegex`` matches a string against a regular expression.
937     (Michael Hudson-Doyle)
938
939   * ``MatchesStructure`` matches attributes of an object against given
940     matchers.  (Michael Hudson-Doyle)
941
942   * ``AfterPreproccessing`` matches values against a matcher after passing them
943     through a callable.  (Michael Hudson-Doyle)
944
945   * ``MatchesSetwise`` matches an iterable of matchers against an iterable of
946     values, without regard to order.  (Michael Hudson-Doyle)
947
948 * ``setup.py`` can now build a snapshot when Bazaar is installed but the tree
949   is not a Bazaar tree. (Jelmer Vernooij)
950
951 * Support for running tests using distutils (Christian Kampka, #726539)
952
953 * Vastly improved and extended documentation. (Jonathan Lange)
954
955 * Use unittest2 exception classes if available. (Jelmer Vernooij)
956
957
958 0.9.8
959 ~~~~~
960
961 In this release we bring some very interesting improvements:
962
963 * new matchers for exceptions, sets, lists, dicts and more.
964
965 * experimental (works but the contract isn't supported) twisted reactor
966   support.
967
968 * The built in runner can now list tests and filter tests (the -l and
969   --load-list options).
970
971 Changes
972 -------
973
974 * addUnexpectedSuccess is translated to addFailure for test results that don't
975   know about addUnexpectedSuccess.  Further, it fails the entire result for
976   all testtools TestResults (i.e. wasSuccessful() returns False after
977   addUnexpectedSuccess has been called). Note that when using a delegating
978   result such as ThreadsafeForwardingResult, MultiTestResult or
979   ExtendedToOriginalDecorator then the behaviour of addUnexpectedSuccess is
980   determined by the delegated to result(s).
981   (Jonathan Lange, Robert Collins, #654474, #683332)
982
983 * startTestRun will reset any errors on the result.  That is, wasSuccessful()
984   will always return True immediately after startTestRun() is called. This
985   only applies to delegated test results (ThreadsafeForwardingResult,
986   MultiTestResult and ExtendedToOriginalDecorator) if the delegated to result
987   is a testtools test result - we cannot reliably reset the state of unknown
988   test result class instances. (Jonathan Lange, Robert Collins, #683332)
989
990 * Responsibility for running test cleanups has been moved to ``RunTest``.
991   This change does not affect public APIs and can be safely ignored by test
992   authors.  (Jonathan Lange, #662647)
993
994 Improvements
995 ------------
996
997 * New matchers:
998
999   * ``EndsWith`` which complements the existing ``StartsWith`` matcher.
1000     (Jonathan Lange, #669165)
1001
1002   * ``MatchesException`` matches an exception class and parameters. (Robert
1003     Collins)
1004
1005   * ``KeysEqual`` matches a dictionary with particular keys.  (Jonathan Lange)
1006
1007 * ``assertIsInstance`` supports a custom error message to be supplied, which
1008   is necessary when using ``assertDictEqual`` on Python 2.7 with a
1009   ``testtools.TestCase`` base class. (Jelmer Vernooij)
1010
1011 * Experimental support for running tests that return Deferreds.
1012   (Jonathan Lange, Martin [gz])
1013
1014 * Provide a per-test decorator, run_test_with, to specify which RunTest
1015   object to use for a given test.  (Jonathan Lange, #657780)
1016
1017 * Fix the runTest parameter of TestCase to actually work, rather than raising
1018   a TypeError.  (Jonathan Lange, #657760)
1019
1020 * Non-release snapshots of testtools will now work with buildout.
1021   (Jonathan Lange, #613734)
1022
1023 * Malformed SyntaxErrors no longer blow up the test suite.  (Martin [gz])
1024
1025 * ``MismatchesAll.describe`` no longer appends a trailing newline.
1026   (Michael Hudson-Doyle, #686790)
1027
1028 * New helpers for conditionally importing modules, ``try_import`` and
1029   ``try_imports``.  (Jonathan Lange)
1030
1031 * ``Raises`` added to the ``testtools.matchers`` module - matches if the
1032   supplied callable raises, and delegates to an optional matcher for validation
1033   of the exception. (Robert Collins)
1034
1035 * ``raises`` added to the ``testtools.matchers`` module - matches if the
1036   supplied callable raises and delegates to ``MatchesException`` to validate
1037   the exception. (Jonathan Lange)
1038
1039 * Tests will now pass on Python 2.6.4 : an ``Exception`` change made only in
1040   2.6.4 and reverted in Python 2.6.5 was causing test failures on that version.
1041   (Martin [gz], #689858).
1042
1043 * ``testtools.TestCase.useFixture`` has been added to glue with fixtures nicely.
1044   (Robert Collins)
1045
1046 * ``testtools.run`` now supports ``-l`` to list tests rather than executing
1047   them. This is useful for integration with external test analysis/processing
1048   tools like subunit and testrepository. (Robert Collins)
1049
1050 * ``testtools.run`` now supports ``--load-list``, which takes a file containing
1051   test ids, one per line, and intersects those ids with the tests found. This
1052   allows fine grained control of what tests are run even when the tests cannot
1053   be named as objects to import (e.g. due to test parameterisation via
1054   testscenarios). (Robert Collins)
1055
1056 * Update documentation to say how to use testtools.run() on Python 2.4.
1057   (Jonathan Lange, #501174)
1058
1059 * ``text_content`` conveniently converts a Python string to a Content object.
1060   (Jonathan Lange, James Westby)
1061
1062
1063
1064 0.9.7
1065 ~~~~~
1066
1067 Lots of little cleanups in this release; many small improvements to make your
1068 testing life more pleasant.
1069
1070 Improvements
1071 ------------
1072
1073 * Cleanups can raise ``testtools.MultipleExceptions`` if they have multiple
1074   exceptions to report. For instance, a cleanup which is itself responsible for
1075   running several different internal cleanup routines might use this.
1076
1077 * Code duplication between assertEqual and the matcher Equals has been removed.
1078
1079 * In normal circumstances, a TestCase will no longer share details with clones
1080   of itself. (Andrew Bennetts, bug #637725)
1081
1082 * Less exception object cycles are generated (reduces peak memory use between
1083   garbage collection). (Martin [gz])
1084
1085 * New matchers 'DoesNotStartWith' and 'StartsWith' contributed by Canonical
1086   from the Launchpad project. Written by James Westby.
1087
1088 * Timestamps as produced by subunit protocol clients are now forwarded in the
1089   ThreadsafeForwardingResult so correct test durations can be reported.
1090   (Martin [gz], Robert Collins, #625594)
1091
1092 * With unittest from Python 2.7 skipped tests will now show only the reason
1093   rather than a serialisation of all details. (Martin [gz], #625583)
1094
1095 * The testtools release process is now a little better documented and a little
1096   smoother.  (Jonathan Lange, #623483, #623487)
1097
1098
1099 0.9.6
1100 ~~~~~
1101
1102 Nothing major in this release, just enough small bits and pieces to make it
1103 useful enough to upgrade to.
1104
1105 In particular, a serious bug in assertThat() has been fixed, it's easier to
1106 write Matchers, there's a TestCase.patch() method for those inevitable monkey
1107 patches and TestCase.assertEqual gives slightly nicer errors.
1108
1109 Improvements
1110 ------------
1111
1112 * 'TestCase.assertEqual' now formats errors a little more nicely, in the
1113   style of bzrlib.
1114
1115 * Added `PlaceHolder` and `ErrorHolder`, TestCase-like objects that can be
1116   used to add results to a `TestResult`.
1117
1118 * 'Mismatch' now takes optional description and details parameters, so
1119   custom Matchers aren't compelled to make their own subclass.
1120
1121 * jml added a built-in UTF8_TEXT ContentType to make it slightly easier to
1122   add details to test results. See bug #520044.
1123
1124 * Fix a bug in our built-in matchers where assertThat would blow up if any
1125   of them failed. All built-in mismatch objects now provide get_details().
1126
1127 * New 'Is' matcher, which lets you assert that a thing is identical to
1128   another thing.
1129
1130 * New 'LessThan' matcher which lets you assert that a thing is less than
1131   another thing.
1132
1133 * TestCase now has a 'patch()' method to make it easier to monkey-patching
1134   objects in tests. See the manual for more information. Fixes bug #310770.
1135
1136 * MultiTestResult methods now pass back return values from the results it
1137   forwards to.
1138
1139 0.9.5
1140 ~~~~~
1141
1142 This release fixes some obscure traceback formatting issues that probably
1143 weren't affecting you but were certainly breaking our own test suite.
1144
1145 Changes
1146 -------
1147
1148 * Jamu Kakar has updated classes in testtools.matchers and testtools.runtest
1149   to be new-style classes, fixing bug #611273.
1150
1151 Improvements
1152 ------------
1153
1154 * Martin[gz] fixed traceback handling to handle cases where extract_tb returns
1155   a source line of None. Fixes bug #611307.
1156
1157 * Martin[gz] fixed an unicode issue that was causing the tests to fail,
1158   closing bug #604187.
1159
1160 * testtools now handles string exceptions (although why would you want to use
1161   them?) and formats their tracebacks correctly. Thanks to Martin[gz] for
1162   fixing bug #592262.
1163
1164 0.9.4
1165 ~~~~~
1166
1167 This release overhauls the traceback formatting layer to deal with Python 2
1168 line numbers and traceback objects often being local user encoded strings
1169 rather than unicode objects. Test discovery has also been added and Python 3.1
1170 is also supported. Finally, the Mismatch protocol has been extended to let
1171 Matchers collaborate with tests in supplying detailed data about failures.
1172
1173 Changes
1174 -------
1175
1176 * testtools.utils has been renamed to testtools.compat. Importing
1177   testtools.utils will now generate a deprecation warning.
1178
1179 Improvements
1180 ------------
1181
1182 * Add machinery for Python 2 to create unicode tracebacks like those used by
1183   Python 3. This means testtools no longer throws on encountering non-ascii
1184   filenames, source lines, or exception strings when displaying test results.
1185   Largely contributed by Martin[gz] with some tweaks from Robert Collins.
1186
1187 * James Westby has supplied test discovery support using the Python 2.7
1188   TestRunner in testtools.run. This requires the 'discover' module. This
1189   closes bug #250764.
1190
1191 * Python 3.1 is now supported, thanks to Martin[gz] for a partial patch.
1192   This fixes bug #592375.
1193
1194 * TestCase.addCleanup has had its docstring corrected about when cleanups run.
1195
1196 * TestCase.skip is now deprecated in favour of TestCase.skipTest, which is the
1197   Python2.7 spelling for skip. This closes bug #560436.
1198
1199 * Tests work on IronPython patch from Martin[gz] applied.
1200
1201 * Thanks to a patch from James Westby testtools.matchers.Mismatch can now
1202   supply a get_details method, which assertThat will query to provide
1203   additional attachments. This can be used to provide additional detail
1204   about the mismatch that doesn't suite being included in describe(). For
1205   instance, if the match process was complex, a log of the process could be
1206   included, permitting debugging.
1207
1208 * testtools.testresults.real._StringException will now answer __str__ if its
1209   value is unicode by encoding with UTF8, and vice versa to answer __unicode__.
1210   This permits subunit decoded exceptions to contain unicode and still format
1211   correctly.
1212
1213 0.9.3
1214 ~~~~~
1215
1216 More matchers, Python 2.4 support, faster test cloning by switching to copy
1217 rather than deepcopy and better output when exceptions occur in cleanups are
1218 the defining characteristics of this release.
1219
1220 Improvements
1221 ------------
1222
1223 * New matcher "Annotate" that adds a simple string message to another matcher,
1224   much like the option 'message' parameter to standard library assertFoo
1225   methods.
1226
1227 * New matchers "Not" and "MatchesAll". "Not" will invert another matcher, and
1228   "MatchesAll" that needs a successful match for all of its arguments.
1229
1230 * On Python 2.4, where types.FunctionType cannot be deepcopied, testtools will
1231   now monkeypatch copy._deepcopy_dispatch using the same trivial patch that
1232   added such support to Python 2.5. The monkey patch is triggered by the
1233   absence of FunctionType from the dispatch dict rather than a version check.
1234   Bug #498030.
1235
1236 * On windows the test 'test_now_datetime_now' should now work reliably.
1237
1238 * TestCase.getUniqueInteger and TestCase.getUniqueString now have docstrings.
1239
1240 * TestCase.getUniqueString now takes an optional prefix parameter, so you can
1241   now use it in circumstances that forbid strings with '.'s, and such like.
1242
1243 * testtools.testcase.clone_test_with_new_id now uses copy.copy, rather than
1244   copy.deepcopy. Tests that need a deeper copy should use the copy protocol to
1245   control how they are copied. Bug #498869.
1246
1247 * The backtrace test result output tests should now pass on windows and other
1248   systems where os.sep is not '/'.
1249
1250 * When a cleanUp or tearDown exception occurs, it is now accumulated as a new
1251   traceback in the test details, rather than as a separate call to addError / 
1252   addException. This makes testtools work better with most TestResult objects
1253   and fixes bug #335816.
1254
1255
1256 0.9.2
1257 ~~~~~
1258
1259 Python 3 support, more matchers and better consistency with Python 2.7 --
1260 you'd think that would be enough for a point release. Well, we here on the
1261 testtools project think that you deserve more.
1262
1263 We've added a hook so that user code can be called just-in-time whenever there
1264 is an exception, and we've also factored out the "run" logic of test cases so
1265 that new outcomes can be added without fiddling with the actual flow of logic.
1266
1267 It might sound like small potatoes, but it's changes like these that will
1268 bring about the end of test frameworks.
1269
1270
1271 Improvements
1272 ------------
1273
1274 * A failure in setUp and tearDown now report as failures not as errors.
1275
1276 * Cleanups now run after tearDown to be consistent with Python 2.7's cleanup
1277   feature.
1278
1279 * ExtendedToOriginalDecorator now passes unrecognised attributes through
1280   to the decorated result object, permitting other extensions to the
1281   TestCase -> TestResult protocol to work.
1282
1283 * It is now possible to trigger code just-in-time after an exception causes
1284   a test outcome such as failure or skip. See the testtools MANUAL or
1285   ``pydoc testtools.TestCase.addOnException``. (bug #469092)
1286
1287 * New matcher Equals which performs a simple equality test.
1288
1289 * New matcher MatchesAny which looks for a match of any of its arguments.
1290
1291 * TestCase no longer breaks if a TestSkipped exception is raised with no
1292   parameters.
1293
1294 * TestCase.run now clones test cases before they are run and runs the clone.
1295   This reduces memory footprint in large test runs - state accumulated on
1296   test objects during their setup and execution gets freed when test case
1297   has finished running unless the TestResult object keeps a reference.
1298   NOTE: As test cloning uses deepcopy, this can potentially interfere if
1299   a test suite has shared state (such as the testscenarios or testresources
1300   projects use).  Use the __deepcopy__ hook to control the copying of such
1301   objects so that the shared references stay shared.
1302
1303 * Testtools now accepts contributions without copyright assignment under some
1304   circumstances. See HACKING for details.
1305
1306 * Testtools now provides a convenient way to run a test suite using the
1307   testtools result object: python -m testtools.run testspec [testspec...].
1308
1309 * Testtools now works on Python 3, thanks to Benjamin Peterson.
1310
1311 * Test execution now uses a separate class, testtools.RunTest to run single
1312   tests. This can be customised and extended in a more consistent fashion than
1313   the previous run method idiom. See pydoc for more information.
1314
1315 * The test doubles that testtools itself uses are now available as part of
1316   the testtools API in testtols.testresult.doubles.
1317
1318 * TracebackContent now sets utf8 as the charset encoding, rather than not
1319   setting one and encoding with the default encoder.
1320
1321 * With python2.7 testtools.TestSkipped will be the unittest.case.SkipTest
1322   exception class making skips compatible with code that manually raises the
1323   standard library exception. (bug #490109)
1324
1325 Changes
1326 -------
1327
1328 * TestCase.getUniqueInteger is now implemented using itertools.count. Thanks
1329   to Benjamin Peterson for the patch. (bug #490111)
1330
1331
1332 0.9.1
1333 ~~~~~
1334
1335 The new matcher API introduced in 0.9.0 had a small flaw where the matchee
1336 would be evaluated twice to get a description of the mismatch. This could lead
1337 to bugs if the act of matching caused side effects to occur in the matchee.
1338 Since having such side effects isn't desirable, we have changed the API now
1339 before it has become widespread.
1340
1341 Changes
1342 -------
1343
1344 * Matcher API changed to avoid evaluating matchee twice. Please consult
1345   the API documentation.
1346
1347 * TestCase.getUniqueString now uses the test id, not the test method name,
1348   which works nicer with parameterised tests.
1349
1350 Improvements
1351 ------------
1352
1353 * Python2.4 is now supported again.
1354
1355
1356 0.9.0
1357 ~~~~~
1358
1359 This release of testtools is perhaps the most interesting and exciting one
1360 it's ever had. We've continued in bringing together the best practices of unit
1361 testing from across a raft of different Python projects, but we've also
1362 extended our mission to incorporating unit testing concepts from other
1363 languages and from our own research, led by Robert Collins.
1364
1365 We now support skipping and expected failures. We'll make sure that you
1366 up-call setUp and tearDown, avoiding unexpected testing weirdnesses. We're
1367 now compatible with Python 2.5, 2.6 and 2.7 unittest library.
1368
1369 All in all, if you are serious about unit testing and want to get the best
1370 thinking from the whole Python community, you should get this release.
1371
1372 Improvements
1373 ------------
1374
1375 * A new TestResult API has been added for attaching details to test outcomes.
1376   This API is currently experimental, but is being prepared with the intent
1377   of becoming an upstream Python API. For more details see pydoc
1378   testtools.TestResult and the TestCase addDetail / getDetails methods.
1379
1380 * assertThat has been added to TestCase. This new assertion supports
1381   a hamcrest-inspired matching protocol. See pydoc testtools.Matcher for
1382   details about writing matchers, and testtools.matchers for the included
1383   matchers. See http://code.google.com/p/hamcrest/.
1384
1385 * Compatible with Python 2.6 and Python 2.7
1386
1387 * Failing to upcall in setUp or tearDown will now cause a test failure.
1388   While the base methods do nothing, failing to upcall is usually a problem
1389   in deeper hierarchies, and checking that the root method is called is a
1390   simple way to catch this common bug.
1391
1392 * New TestResult decorator ExtendedToOriginalDecorator which handles
1393   downgrading extended API calls like addSkip to older result objects that
1394   do not support them. This is used internally to make testtools simpler but
1395   can also be used to simplify other code built on or for use with testtools.
1396
1397 * New TextTestResult supporting the extended APIs that testtools provides.
1398
1399 * Nose will no longer find 'runTest' tests in classes derived from
1400    testtools.testcase.TestCase (bug #312257).
1401
1402 * Supports the Python 2.7/3.1 addUnexpectedSuccess and addExpectedFailure
1403   TestResult methods, with a support function 'knownFailure' to let tests
1404   trigger these outcomes.
1405
1406 * When using the skip feature with TestResult objects that do not support it
1407   a test success will now be reported. Previously an error was reported but
1408   production experience has shown that this is too disruptive for projects that
1409   are using skips: they cannot get a clean run on down-level result objects.
1410
1411
1412 .. _testtools: http://pypi.python.org/pypi/testtools