A collection of recipes, examples, and tests around Web API Testing in Python
Current examples, recipes, etc., that exist in this repo:
- How to send a Bearer Token in the Authorization header
- How to use data from one response in another request
- 🐍 Python v3.8 or higher is required
- 📦 Poetry as the package manager
- 👨🏽💻 Microsoft's Python extension installed in VSCode
-
Clone the repo
git clone https://github.com/qa-at-the-point/api-testing-python.git
-
Install packages with Poetry
# Installs all packages from pyproject.toml file poetry install # Then copy the path of the virtual environment poetry env info --path
-
Configure VSCode to use the proper virtual environment
- Open Command Palette (
CMD + SHIFT + P
orCTRL + SHIFT + P
) - Find and click
Python: Select Interpreter
- Paste the virtual environment path if it's not listed
- Open Command Palette (
Examples and Recipes should include the instructions and commands to run the tests. However, the base command is always the same:
poetry run pytest
If you've found an bug or you have an idea or feature request, please create an issue on the Issues Tab