Skip to main content

pytest-srcpaths

Add paths to sys.path.
A pytest plugin to help pytest find the code you want to test.

Installation

Install with pip:

pip install pytest-srcpaths

Usage

Add a line in your pytest.ini file with a key of srcpaths. It should contain a space-separated list of paths.

[pytest]
srcpaths = src lib

Paths are relative to the directory that pytest.ini is in.
You can include the top level directory with a dot.

[pytest]
srcpaths = .

Alternatively, use pythonpath

The option pythonpath also works the same.

[pytest]
pythonpath = src lib

pytest 7 (not released yet) is planned to include the pythonpath option.

For pytest 6.2.x, this plugin will work.

Changelog

  • 1.2.1 - Add pythonpath as an alternative to srcpath option for pytest versions < 7.0.0
    • this is to allow this project to act as a temporary workaround until pytest 7 is released

Similar project

This plugin was inspired by pytest-pythonpath whose implementation and scope are a bit different.

Metadata

Release files for pytest-srcpaths 1.2.1

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-srcpaths 1.2.1
File Size Uploaded Provenance Actions
pytest-srcpaths-1.2.1.tar.gz 5.7 kB Without provenance Details for pytest-srcpaths-1.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pytest-srcpaths 1.2.1
File Interpreter ABI Platform Actions
pytest_srcpaths-1.2.1-py3-none-any.whl Python 3 none any Details for pytest_srcpaths-1.2.1-py3-none-any.whl

Total release size: 8.8 kB

Release files / pytest-srcpaths-1.2.1.tar.gz

Download URL pytest-srcpaths-1.2.1.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
78d71b9a2ece6839654421400c4ec78b6b1c1c101cdeda958acb08f1c6847216
BLAKE2b-256 checksum
How to use checksums
24abe92762ad7d65ff524936c38d8dae5be69e8ee8cac35f0b75d09fcf8057cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.26.0

Release files / pytest_srcpaths-1.2.1-py3-none-any.whl

Download URL pytest_srcpaths-1.2.1-py3-none-any.whl
Size 3.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
222b68659e4bd401034b45b38b81f4103afb12807128460e19b6fb82b0e227e7
BLAKE2b-256 checksum
How to use checksums
4d04fe9a045df1b9c949b722fe6f8dedf665bd67dc9cc8afc80818f3702dca1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.26.0

Security for pytest-srcpaths 1.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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