Skip to main content

Pytest plugin for testing examples in docstrings and markdown files.

Project description

pytest-examples

CI pypi versions license

Pytest plugin for testing examples in docstrings and markdown files.

Installation

pip install -U pytest-examples

Usage

import pytest
from pytest_examples import find_examples, CodeExample, ExampleRunner

@pytest.mark.parametrize('example', find_examples('foo_dir', 'bar_file.py'))
def test_docstrings(example: CodeExample, run_example: ExampleRunner):
    run_example.run(example)

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_examples-0.0.2.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

pytest_examples-0.0.2-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file pytest_examples-0.0.2.tar.gz.

File metadata

  • Download URL: pytest_examples-0.0.2.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for pytest_examples-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c3038655fc92d9f0800967a294681c997a3a284a44eacc590068e8cc64adb88d
MD5 e5ef83f9f1e62b338134176e21a48229
BLAKE2b-256 abbd11f962c1edad858b978c70e1f6c7772606f07b3458686bc82557f8031a4f

See more details on using hashes here.

File details

Details for the file pytest_examples-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_examples-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8b34515dea994c5b359ee36db337bc53a3bb02d402c5bf6f2ec0f9207d27bd8a
MD5 e3963d4cdf46c5cbc07387af1764a4a5
BLAKE2b-256 be9becd84f97c7ac94b5813f73dd8332a9d00baaf58da8e5d8abc321909d57c4

See more details on using hashes here.

Supported by

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