Skip to main content

Overview

pynose-exclude is a Pynose plugin that allows you to easily specify directories to be excluded from testing.

Exclude Directories

The --exclude-dir= option is made available after installation of the plugin. The option may be used multiple times to exclude multiple directories from testing. The directory paths provided may be absolute or relative.

Example:

$ pynose --exclude-dir=test_dirs/build \
    --exclude-dir=test_dirs/test_not_me test_dirs
....
----------------------------------------------------------------------
Ran 4 tests in 0.006s

OK

This example will exclude the directories test_dirs/build and test_dirs/test_not_me from pynose’ test searching.

Using File-Based Exclusion List

The --exclude-dir-file= option can be used to pass in a predefined list of directories contained within a file. pynose-exclude expects each directory to be excluded to be on its own line.

Example:

$ pynose --exclude-dir-file=test_dirs/exclude_dirs.txt \
    test_dirs
....
----------------------------------------------------------------------
Ran 4 tests in 0.006s

OK

where exclude_dirs.txt might look like:

test_dirs/build
# Start a line with a '#' to include
# Comments
test_dirs/test_not_me

Excluding Specific Test Methods and Classes

Tests can now be excluded by specifying their fully qualified test paths. Tests can be excluded using either --exclude-test or --exclude-test-file.

To exclude test methods:

--exclude-test=module1.module2.TestClass.test_method

To exclude test classes:

--exclude-test=module1.module2.TestClass

To exclude test functions:

--exclude-test=module1.module2.test_function

Using Environment Variables

--exclude-dir= and --exclude-test= can be set by the environment variables PYNOSE_EXCLUDE_DIRS and PYNOSE_EXCLUDE_TESTS respectively. Multiple exclude paths may be entered by separating them using a ;. The environment variable PYNOSE_EXCLUDE_DIRS_FILE when set to the path of a file-based exclusion list functions as though it were passed in with --exclude-dir-file=.

Pynose Configuration Files

pynose-exclude options can also be passed to pynose using a .pynoserc or pynose.cfg file. If you more than one directory are to be excluded separate their values with newlines using the same configuration key:

[nosetests]
exclude-dir=test_dirs/exclude_dirs
            test_dirs/more_excludes

Bugs

Please report all bugs (and patches) to https://github.com/nyefan/pynose-exclude/

NOTE: The previous bitbucket repository is no longer actively maintained.

Metadata

Release files for pynose-exclude 1.0.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 pynose-exclude 1.0.1
File Size Uploaded
pynose_exclude-1.0.1.tar.gz 15.2 kB Details

Release files / pynose_exclude-1.0.1.tar.gz

Download URL pynose_exclude-1.0.1.tar.gz
Size 15.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ef41ce272f8f41f9d4a22a2eb49197d09bd377fc86573f440973b9b65c077b52
BLAKE2b-256 checksum
How to use checksums
fd536d82c882e19ce14c206f7a58e9f9ea9d017a777c2913bc53a208f25e81c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release history Release notifications | RSS feed

This release

1.0.1 This release

1 release file

1.0.0

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