METADATA 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. Metadata-Version: 2.1
  2. Name: pytest-mock
  3. Version: 3.12.0
  4. Summary: Thin-wrapper around the mock package for easier use with pytest
  5. Home-page: https://github.com/pytest-dev/pytest-mock/
  6. Author: Bruno Oliveira
  7. Author-email: nicoddemus@gmail.com
  8. License: MIT
  9. Project-URL: Documentation, https://pytest-mock.readthedocs.io/en/latest/
  10. Project-URL: Changelog, https://pytest-mock.readthedocs.io/en/latest/changelog.html
  11. Project-URL: Source, https://github.com/pytest-dev/pytest-mock/
  12. Project-URL: Tracker, https://github.com/pytest-dev/pytest-mock/issues
  13. Keywords: pytest mock
  14. Platform: any
  15. Classifier: Development Status :: 5 - Production/Stable
  16. Classifier: Framework :: Pytest
  17. Classifier: Intended Audience :: Developers
  18. Classifier: License :: OSI Approved :: MIT License
  19. Classifier: Operating System :: OS Independent
  20. Classifier: Programming Language :: Python :: 3
  21. Classifier: Programming Language :: Python :: 3.8
  22. Classifier: Programming Language :: Python :: 3.9
  23. Classifier: Programming Language :: Python :: 3.10
  24. Classifier: Programming Language :: Python :: 3.11
  25. Classifier: Programming Language :: Python :: 3.12
  26. Classifier: Programming Language :: Python :: 3 :: Only
  27. Classifier: Topic :: Software Development :: Testing
  28. Requires-Python: >=3.8
  29. Description-Content-Type: text/x-rst
  30. License-File: LICENSE
  31. Requires-Dist: pytest >=5.0
  32. Provides-Extra: dev
  33. Requires-Dist: pre-commit ; extra == 'dev'
  34. Requires-Dist: tox ; extra == 'dev'
  35. Requires-Dist: pytest-asyncio ; extra == 'dev'
  36. ===========
  37. pytest-mock
  38. ===========
  39. This plugin provides a ``mocker`` fixture which is a thin-wrapper around the patching API
  40. provided by the `mock package <http://pypi.python.org/pypi/mock>`_:
  41. .. code-block:: python
  42. import os
  43. class UnixFS:
  44. @staticmethod
  45. def rm(filename):
  46. os.remove(filename)
  47. def test_unix_fs(mocker):
  48. mocker.patch('os.remove')
  49. UnixFS.rm('file')
  50. os.remove.assert_called_once_with('file')
  51. Besides undoing the mocking automatically after the end of the test, it also provides other
  52. nice utilities such as ``spy`` and ``stub``, and uses pytest introspection when
  53. comparing calls.
  54. |python| |version| |anaconda| |docs| |ci| |coverage| |black| |pre-commit|
  55. .. |version| image:: http://img.shields.io/pypi/v/pytest-mock.svg
  56. :target: https://pypi.python.org/pypi/pytest-mock
  57. .. |anaconda| image:: https://img.shields.io/conda/vn/conda-forge/pytest-mock.svg
  58. :target: https://anaconda.org/conda-forge/pytest-mock
  59. .. |ci| image:: https://github.com/pytest-dev/pytest-mock/workflows/test/badge.svg
  60. :target: https://github.com/pytest-dev/pytest-mock/actions
  61. .. |coverage| image:: https://coveralls.io/repos/github/pytest-dev/pytest-mock/badge.svg?branch=master
  62. :target: https://coveralls.io/github/pytest-dev/pytest-mock?branch=master
  63. .. |python| image:: https://img.shields.io/pypi/pyversions/pytest-mock.svg
  64. :target: https://pypi.python.org/pypi/pytest-mock/
  65. .. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
  66. :target: https://github.com/ambv/black
  67. .. |pre-commit| image:: https://results.pre-commit.ci/badge/github/pytest-dev/pytest-mock/master.svg
  68. :target: https://results.pre-commit.ci/latest/github/pytest-dev/pytest-mock/master
  69. .. |docs| image:: https://readthedocs.org/projects/pytest-mock/badge/?version=latest
  70. :target: https://pytest-mock.readthedocs.io/en/latest/?badge=latest
  71. `Professionally supported pytest-mock is available <https://tidelift.com/subscription/pkg/pypi-pytest_mock?utm_source=pypi-pytest-mock&utm_medium=referral&utm_campaign=readme>`_.
  72. Documentation
  73. =============
  74. For full documentation, please see https://pytest-mock.readthedocs.io/en/latest.
  75. License
  76. =======
  77. Distributed under the terms of the `MIT`_ license.
  78. .. _MIT: https://github.com/pytest-dev/pytest-mock/blob/master/LICENSE