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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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