Testfixtures

Latest version: v8.3.0

Safety actively analyzes 638396 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 21 of 23

1.8.0

-----------------------

- 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 ``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 :any:`test_time <mock_time>` so that it uses the correct way to
get timezone-less time.

- added :meth:`~testfixtures.datetime.MockDateTime.set` along with `delta` and `delta_type`
parameters to :any:`test_date <mock_date>`, :any:`test_datetime <mock_datetime>` and
:any:`test_time <mock_time>`.

- allow the date class returned by the :meth:`~testfixtures.datetime.MockDate.today` 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

-----------------------

- 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

-------------------------

- 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

-------------------------

- 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

-------------------

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

- fixed test failure in Python 2.6.

1.5.4

-------------------

- 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.

Page 21 of 23

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.