Changes
=======

.. currentmodule:: testfixtures

2.0.0 (23 September 2011)
-------------------------

- :func:`compare` now uses a registry of comparers that can be
  modified either by passing a `registry` option to :func:`compare`
  or, globally, using the :func:`~comparison.register` function.

- added a comparer for :class:`set` instances to :func:`compare`.

- added a new `show_whitespace` parameter to
  :func:`~comparison.compare_text`, the comparer used when comparing
  strings and unicodes with :func:`compare`.

- The internal queue for :class:`test_datetime` is now considered to
  be in local time. This has implication on the values returned from
  both :meth:`~tdatetime.now` and :meth:`~tdatetime.utcnow` when
  `tzinfo` is passed to the :class:`test_datetime` constructor.

- :meth:`set` and :meth:`add` on :class:`test_date`,
  :class:`test_datetime` and :class:`test_time` now accept instances
  of the appropriate type as an alternative to just passing in the
  parameters to create the instance.

- Refactored the monolithic ``__init__.py`` into modules for each
  type of functionality.

1.12.0 (16 August 2011)
-----------------------

- Add a :attr:`~OutputCapture.captured` property to
  :class:`OutputCapture` so that more complex assertion can be made
  about the output that has been captured.

- :class:`OutputCapture` context managers can now be temporarily
  disabled using their :meth:`~OutputCapture.disable` method.

- Logging can now be captured only when it exceeds a specified logging
  level.

- The handling of timezones has been reworked in both
  :func:`test_datetime` and :func:`test_time`. This is not backwards
  compatible but is much more useful and correct.

1.11.3 (3 August 2011)
----------------------

- Fix bugs where various :meth:`test_date`, :meth:`test_datetime` and
  :meth:`test_time` methods didn't accept keyword parameters.

1.11.2 (28 July 2011)
---------------------

- Fix for 1.10 and 1.11 releases that didn't include non-.py files as
  a result of the move from subversion to git.

1.11.1 (28 July 2011)
---------------------

- Fix bug where :meth:`tdatetime.now` didn't accept the `tz`
  parameter that :meth:`datetime.datetime.now` did.

1.11.0 (27 July 2011)
---------------------

- Give more useful output when comparing dicts and their subclasses.

- Turn :class:`should_raise` into a decorator form of
  :class:`ShouldRaise` rather than the rather out-moded wrapper
  function that it was.

1.10.0 (19 July 2011)
---------------------

- Remove dependency on :mod:`zope.dottedname`.

- Implement the ability to mock out :class:`dict` and :class:`list`
  items using :class:`~testfixtures.Replacer` and
  :func:`~testfixtures.replace`.

- Implement the ability to remove attributes and :class:`dict`
  items using :class:`~testfixtures.Replacer` and
  :func:`~testfixtures.replace`.

1.9.2 (20 April 2011)
---------------------

- Fix for issue #328: :meth:`~tdatetime.utcnow` of :func:`test_datetime`
  now returns items from the internal queue in the same way as 
  :meth:`~tdatetime.now`.

1.9.1 (11 March 2011)
------------------------

- Fix bug when :class:`ShouldRaise` context managers incorrectly
  reported what exception was incorrectly raised when the incorrectly
  raised exception was a :class:`KeyError`.

1.9.0 (11 February 2011)
------------------------

- Added :class:`~components.TestComponents` for getting a sterile
  registry when testing code that uses :mod:`zope.component`.

1.8.0 (14 January 2011)
-----------------------

- Added full Sphinx-based documentation.

- added a `Manuel <http://packages.python.org/manuel/>`__ plugin for
  reading and writing files into a :class:`TempDirectory`.

- any existing log handlers present when a :class:`LogCapture` is
  installed for a particular logger are now removed.

- fix the semantics of :class:`should_raise`, which should always
  expect an exception to be raised!

- added the :class:`ShouldRaise` context manager.

- added recursive support to :meth:`TempDirectory.listdir` and added
  the new :meth:`TempDirectory.check_all` method.

- added support for forward-slash separated paths to all relevant
  :class:`TempDirectory` methods.

- added :meth:`TempDirectory.getpath` method.

- allow files and directories to be ignored by a regular expression
  specification when using :class:`TempDirectory`.

- made :class:`Comparison` objects work when the attributes expected
  might be class attributes.

- re-implement :func:`test_time` so that it uses the correct way to
  get timezone-less time.

- added :meth:`~tdatetime.set` along with `delta` and `delta_type`
  parameters to :func:`test_date`, :func:`test_datetime` and
  :func:`test_time`.

- allow the date class returned by the :meth:`tdatetime.date` method
  to be configured.

- added the :class:`OutputCapture` context manager.

- added the :class:`StringComparison` class.

- added options to ignore trailing whitespace and blank lines when
  comparing multi-line strings with :func:`compare`.

- fixed bugs in the handling of some exception types when using
  :class:`Comparison`, :class:`ShouldRaise` or :class:`should_raise`.

- changed :func:`wrap` to correctly set __name__, along with some
  other attributes, which should help when using the decorators with
  certain testing frameworks.

1.7.0 (20 January 2010)
-----------------------

- fixed a bug where the @replace decorator passed a classmethod
  rather than the replacment to the decorated callable when replacing
  a classmethod

- added set method to test_date, test_datetime and test_time to allow
  setting the parameters for the next instance to be returned.

- added delta and delta_type parameters to test_date,test_datetime and
  test_time to control the intervals between returned instances.


1.6.2 (23 September 2009)
-------------------------

- changed Comparison to use __eq__ and __ne__ instead of the
  deprecated __cmp__

- documented that order matters when using Comparisons with objects
  that implement __eq__ themselves, such as instances of Django
  models.

1.6.1 (06 September 2009)
-------------------------

- @replace and Replacer.replace can now replace attributes that may
  not be present, provided the `strict` parameter is passed as False.

- should_raise now catches BaseException rather than Exception so
  raising of SystemExit and KeyboardInterrupt can be tested.

1.6.0 (09 May 2009)
-------------------

- added support for using TempDirectory, Replacer and LogCapture as
  context managers.

- fixed test failure in Python 2.6.

1.5.4 (11 Feb 2009)
-------------------

- fix bug where should_raise didn't complain when no exception 
  was raised but one was expected.

- clarified that the return of a should_raise call will be None
  in the event that an exception is raised but no expected 
  exception is specified.

1.5.3 (17 Dec 2008)
-------------------

- should_raise now supports methods other than __call__

1.5.2 (14 Dec 2008)
-------------------

- added `makedir` and `check_dir` methods to TempDirectory and added
  support for sub directories to `read` and `write`

1.5.1 (12 Dec 2008)
-------------------

- added `path` parameter to `write` method of TempDirectory so
  that the full path of the file written can be easilly obtained

1.5.0 (12 Dec 2008)
-------------------

- added handy `read` and `write` methods to TempDirectory for
  creating and reading files in the temporary directory

- added support for rich comparison of objects that don't support
  vars()

1.4.0 (12 Dec 2008)
-------------------

- improved representation of failed Comparison

- improved representation of failed compare with sequences

1.3.1 (10 Dec 2008)
-------------------

- fixed bug that occurs when directory was deleted by a test that
  use tempdir or TempDirectory

1.3.0 (9 Dec 2008)
------------------

- added TempDirectory helper

- added tempdir decorator

1.2.0 (3 Dec 2008)
------------------

- LogCaptures now auto-install on creation unless configured otherwise

- LogCaptures now have a clear method

- LogCaptures now have a class method uninstall_all that uninstalls
  all instances of LogCapture. Handy for a tearDown method in doctests.

1.1.0 (3 Dec 2008)
------------------

- add support to Comparisons for only comparing some attributes

- move to use zope.dottedname

1.0.0 (26 Nov 2008)
-------------------

- Initial Release
