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!"

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-common-subject-1.0.4.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_common_subject-1.0.4-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file pytest-common-subject-1.0.4.tar.gz.

File metadata

  • Download URL: pytest-common-subject-1.0.4.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.8.2 Linux/5.4.0-42-generic

File hashes

Hashes for pytest-common-subject-1.0.4.tar.gz
Algorithm Hash digest
SHA256 e4b63c445cf17033856678edf98b5a1301b0bd86aedd11b5a9fe06aeb6f7a360
MD5 48a2eb0367503b3fbb3ca5385aabf938
BLAKE2b-256 fa37a2d2cfe5683bfc6655df61496397fdb0bc2bbab1c6226848fa3bfc2ab834

See more details on using hashes here.

File details

Details for the file pytest_common_subject-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_common_subject-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 ab296512038ebc14612bf0d6ef5333404162a82b549acc3c92534328f5b51ed9
MD5 0f43f42440d003b474797f132788e916
BLAKE2b-256 b55859e35ea6f7e302971bba3ba5861d9dcc6d55ca06c24a8d1f17e6c80c84fd

See more details on using hashes here.

Release history Release notifications | RSS feed

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.6

2 files

1.0.5

2 files

This release

1.0.4 This release

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 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