pact-python2.2.2
Published
Tool for creating and verifying consumer-driven contracts using the Pact framework.
pip install pact-python
Package Downloads
Project URLs
Requires Python
>=3.9
Dependencies
- cffi
~=1.0
- click
~=8.0
- fastapi
~=0.0
- psutil
~=6.0
- requests
~=2.0
- six
~=1.0
- typing-extensions
~=4.0; python_version < "3.10"
- uvicorn
~=0.0
- yarl
~=1.0
- aiohttp
[speedups]~=3.0; extra == "devel"
- coverage
[toml]~=7.0; extra == "devel"
- flask
[async]~=3.0; extra == "devel"
- httpx
~=0.0; extra == "devel"
- mkdocs-gen-files
~=0.5; extra == "devel"
- mkdocs-literate-nav
~=0.6; extra == "devel"
- mkdocs-material
[imaging]~=9.4; extra == "devel"
- mkdocs-section-index
~=0.3; extra == "devel"
- mkdocstrings
[python]~=0.23; extra == "devel"
- mkdocs
~=1.5; extra == "devel"
- mock
~=5.0; extra == "devel"
- mypy
==1.11.2; extra == "devel"
- pytest-asyncio
~=0.0; extra == "devel"
- pytest-bdd
~=7.0; extra == "devel"
- pytest-cov
~=5.0; extra == "devel"
- pytest
~=8.0; extra == "devel"
- ruff
==0.6.9; extra == "devel"
- testcontainers
~=4.0; extra == "devel"
- types-cffi
~=1.0; extra == "devel"
- types-requests
~=2.0; extra == "devel"
- mkdocs-gen-files
~=0.5; extra == "devel-docs"
- mkdocs-literate-nav
~=0.6; extra == "devel-docs"
- mkdocs-material
[imaging]~=9.4; extra == "devel-docs"
- mkdocs-section-index
~=0.3; extra == "devel-docs"
- mkdocstrings
[python]~=0.23; extra == "devel-docs"
- mkdocs
~=1.5; extra == "devel-docs"
- aiohttp
[speedups]~=3.0; extra == "devel-test"
- coverage
[toml]~=7.0; extra == "devel-test"
- flask
[async]~=3.0; extra == "devel-test"
- httpx
~=0.0; extra == "devel-test"
- mock
~=5.0; extra == "devel-test"
- pytest-asyncio
~=0.0; extra == "devel-test"
- pytest-bdd
~=7.0; extra == "devel-test"
- pytest-cov
~=5.0; extra == "devel-test"
- pytest
~=8.0; extra == "devel-test"
- testcontainers
~=4.0; extra == "devel-test"
- mypy
==1.11.2; extra == "devel-types"
- types-cffi
~=1.0; extra == "devel-types"
- types-requests
~=2.0; extra == "devel-types"
Pact Python
Pact is the de-facto API contract testing tool. Replace expensive and brittle end-to-end integration tests with fast, reliable and easy to debug unit tests.
Why use Pact? Contract testing with Pact lets you:
Watch our series on the problems with end-to-end integrated tests, and how contract testing can help. |
Documentation
This readme provides a high-level overview of the Pact Python library. For detailed documentation, please refer to the full Pact Python documentation. For a more general overview of Pact and the rest of the ecosystem, please refer to the Pact documentation.
Documentation for the API is generated from the docstrings in the code which you can view here. Please be aware that only the [pact.v3
module][pact.v3] is thoroughly documented at this time.
Need Help
- Join our community slack workspace.
- Stack Overflow is a great place to ask questions.
- Say 👋 on Twitter: @pact_up
- Join a discussion 💬 on GitHub Discussions
- Raise an issue on GitHub
V3 Preview
Pact Python is currently undergoing a major rewrite which will be released with the 3.0.0
version. This rewrite will replace the existing Ruby backend with a Rust backend which will provide a significant performance improvement and will allow us to support more features in the future. You can find more information about this rewrite in this tracking issue on GitHub.
You can preview the new version by using the [pact.v3
module][pact.v3]. The new version is not yet feature complete, and may be subject to changes. Having said that, we would love to get your feedback on the new version:
- For any issues you find, please raise an issue on GitHub.
- For any feedback you have, please join the discussion either on GitHub Discussions or in the
#pact-python
channel on the Pact Foundation Slack.
Installation
The latest version of Pact Python can be installed from PyPi:
pip install pact-python
# 🚀 now write some tests!
Requirements
Pact Python tries to support all versions of Python that are still supported by the Python Software Foundation. Older version of Python may work, but are not officially supported.
In order to support the broadest range of use cases, Pact Python tries to impose the least restrictions on the versions of libraries that it uses.
Do Not Track
In order to get better statistics as to who is using Pact, we have an anonymous tracking event that triggers when Pact installs for the first time. The only things we track are your type of OS, and the version information for the package being installed. No personally identifiable information is sent as part of this request. You can disable tracking by setting the environment variable PACT_DO_NOT_TRACK=1
:
Contributing
We welcome contributions to the Pact Python library in many forms. There are many ways to help, from writing code, to providing new examples, to writing documentation, to testing the library and providing feedback. For more information, see the contributing guide.