Python module
A single Python source file, ending in .py, whose functions and classes other files can import.
In more detail
In the course each piece of code under test is a small module, such as pricing.py, and each test file imports from it. pytest also uses the word module for a scope: a module-scoped fixture is built once per test file.
Example
from pricing import subtotal, with_vatRelated terms
- Python — A popular general-purpose programming language known for readable code and a large standard library.
- fixture scope — How long pytest keeps one fixture value before building a new one: per test function, class, module, package or whole session.
- conftest.py — A special pytest file whose fixtures and hooks are available to every test in its directory and below without importing them.
Taught in
- Arrange, Act, Assert — Automated Testing, TDD & Quality Engineering
- Introducing pytest — Automated Testing, TDD & Quality Engineering
- Fixtures And Their Scope — Automated Testing, TDD & Quality Engineering