Case

Latest version: v1.5.3

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

Scan your dependencies

Page 2 of 4

1.3.0

=====
:release-date: 2016-07-18 05:33 p.m. PDT
:release-by: Ask Solem

- Case is now a py.test plug-in and provides a `patching` fixture
as a shortcut to `monkeypatch` setting the value to a mock.

This does not have any effects for users not using py.test.

Example:

.. code-block:: python

def test_foo(patching):
execv value here will be mock.MagicMock by default.
execv = patching('os.execv')

patching('sys.platform', 'darwin') set concrete value
patching.setenv('DJANGO_SETTINGS_MODULE', 'x.settings')

val will be of type mock.MagicMock by default
val = patching.setitem('path.to.dict', 'KEY')

.. _version-1.2.3:

1.2.3

=====
:release-date: 2016-06-15 03:00 p.m. PDT
:release-by: Ask Solem

- Case decorators now supports py.test.

- Patcher created by create_patcher now accepts *args.

.. _version-1.2.2:

1.2.2

=====
:release-date: 2016-06-23 02:46 p.m. PDT
:release-by: Ask Solem

- ``mock.reload_modules``: Fixed compatibility with Python 3.

.. _version-1.2.1:

1.2.1

=====
:release-date: 2016-06-23 12:111 p.m. PDT
:release-by: Ask Solem

- ``mock.reload_modules`` now re-imports the module and
calls ``reload()`` on it.

This fixes issues with side effects not being properly reset after
context exits.

.. _version-1.2.0:

1.2.0

=====
:release-date: 2016-06-13 05:00 p.m. PDT
:release-by: Ask Solem

- Adds ``mock.mute`` decorator to suppress stdout with no return value.

Contributed by Tony Narlock.

- Adds ``Mock.on_nth_call_do_raise(excA, excB, n)``.

This will make the mock raise excA until called n times, in which
it will start to raise excB.

.. _version-1.1.4:

1.1.4

=====
:release-date: 2016-05-12 03:04 p.m. PDT
:release-by: Ask Solem

- ``case.patch.*`` functions now supports using ``new`` as a positional
argument, for compatibility with ``mock.patch``.

.. _version-1.1.3:

Page 2 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.