Skip to main content

pytest-common-subject

pytest-common-subject PyPI version pytest-common-subject PyPI pyversions pytest-common-subject PyPI license

pytest-common-subject is a "framework" for organizing tests to reduce boilerplate while writing, improve skimmability when reading, and bolster parallelization when executing the suite.

To utilize this framework, we first choose a single function that our group of tests will all call — in other words, an entry point, or a common subject. This function will be automatically called before each of our tests, with args and kwargs that can be customized by overriding fixtures — enabling child test classes to make HTTP requests as a different user, or to use a different cache backend, or to change the value of a monkeypatched method.

The return value of the chosen function will be passed as a fixture to each test. To reap the full benefits of the framework, create separate tests to verify different aspects of the return value. Was the response status code a 200? Did the response contain the expected data? Were the expected rows created in the database? By using separate tests for each of these aspects, we can pinpoint and correct multiple bugs at once, instead of getting sucked into a fix-test-fix cycle with its chorus of "oh, bother, not again!"

Metadata

Release files for pytest-common-subject 1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-common-subject 1.0.5
File Size Uploaded
pytest-common-subject-1.0.5.tar.gz 8.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-common-subject 1.0.5
File Interpreter ABI Platform
pytest_common_subject-1.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 16.7 kB

Release files / pytest-common-subject-1.0.5.tar.gz

Download URL pytest-common-subject-1.0.5.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
acfa86af84c122bb4cda538ca76c78d11d8da68dfd25a3831e756a525d0ca13c
BLAKE2b-256 checksum
How to use checksums
249662666e7b9b3517055bf6d11f6e4ecf2ac50fa63e1b8275677afae00cb349
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.10 CPython/3.8.5 Linux/5.4.0-53-generic

Release files / pytest_common_subject-1.0.5-py3-none-any.whl

Download URL pytest_common_subject-1.0.5-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
afb7eccf7f7f836890be0f517fa4731142577f01058c003b6b63cf322a4eb7ec
BLAKE2b-256 checksum
How to use checksums
a9b0fe148d546ce9e73631a79fd0a9d112163a1041d5d8dd22ccfb7c1ffc664a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.10 CPython/3.8.5 Linux/5.4.0-53-generic

Release history Release notifications | RSS feed

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.6

2 release files

This release

1.0.5 This release

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page