Skip to main content

Plugin to count actual number of asserts in pytest

Project description

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

Project details


Download files

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

Source Distribution

pytest-assertcount-1.0.0.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

pytest_assertcount-1.0.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file pytest-assertcount-1.0.0.tar.gz.

File metadata

  • Download URL: pytest-assertcount-1.0.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for pytest-assertcount-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e8271a284e337f89a28789790e68faa18ab8d5e1ca9aad5bd439a672b836a76b
MD5 1efb1a8f1a5a3e2c4002a3dc29881a0a
BLAKE2b-256 849fe6eee30903096887e2fa359163a4ed0969dfd81b301400f5c46fe3e99a41

See more details on using hashes here.

File details

Details for the file pytest_assertcount-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pytest_assertcount-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for pytest_assertcount-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 08a2945248f666787ee1413736fff91875e355aee23bf03900d1438bd4bf81ec
MD5 2c86e33018c5344a128e21c4ffabe477
BLAKE2b-256 618d4415383d305c7d79271e8e349dedc62d7a2a00f997d894b12a18b3ec487a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page