Skip to main content

AssertCount

A pytest plugin to count the actual number of asserts in a pytest run.

Output

The output will be shown as the second last result in the pytest output, right above short test summary info.
Example:

...
===== assert statistics =====
total asserts : 1
passed asserts: 1 (100%)
failed asserts: 0 (0%)
== short test summary info ==
...

The plugin is only able to count asserts in test_XYZ.py files. When using utils-files name them test_utils.

Setup

In order to use the plugin, you have to define a pytest.ini file in the root directory of your project. This file should contain the following lines:

[pytest]
enable_assertion_pass_hook=true

Release files for pytest-assertcount 1.0.0

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-assertcount 1.0.0
File Size Uploaded
pytest-assertcount-1.0.0.tar.gz 2.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-assertcount 1.0.0
File Interpreter ABI Platform
pytest_assertcount-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 5.9 kB

Release files / pytest-assertcount-1.0.0.tar.gz

Download URL pytest-assertcount-1.0.0.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e8271a284e337f89a28789790e68faa18ab8d5e1ca9aad5bd439a672b836a76b
BLAKE2b-256 checksum
How to use checksums
849fe6eee30903096887e2fa359163a4ed0969dfd81b301400f5c46fe3e99a41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/5.0.0 pkginfo/1.8.2 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.7.3

Release files / pytest_assertcount-1.0.0-py3-none-any.whl

Download URL pytest_assertcount-1.0.0-py3-none-any.whl
Size 3.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
08a2945248f666787ee1413736fff91875e355aee23bf03900d1438bd4bf81ec
BLAKE2b-256 checksum
How to use checksums
618d4415383d305c7d79271e8e349dedc62d7a2a00f997d894b12a18b3ec487a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/5.0.0 pkginfo/1.8.2 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

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