Skip to main content

Nose plugin to add warnings filters (turn them into error) using nose.cfg file.

Project description

Allow to inject warning filters during nosetest.

Put the same arguments as warnings.filterwarnings in setup.cfg at the root of your project. Separated each argument by pipes |, one filter per line. Whitespace are stripped.

for example:

[nosetests]
warningfilters=default         |.*            |DeprecationWarning |notebook.*
               ignore          |.*metadata.*  |DeprecationWarning |notebook.*
               once            |.*schema.*    |UserWarning        |nbfor.*
               error           |.*warn.*      |DeprecationWarning |notebook.services.contents.manager*

If you prefer another name for the configuration file, you can tell nose to load the configuration using the -c flag: run the tests with nosetests -c nose.cfg.

details configuration.

Each line of warning filter is separated in maximum 4 sections, that match the first 4 sections of filterwarnings:

filterwarnings(action, message="", category=Warning, module="", lineno=0, append=False)

fields 2 to 4 can be omitted, ie to say 1 line can be of the following form:

action
action| message
action| message | category
action| message | category | module

the value of each fields is treated the same as for filterwarnigns except: - whitespace are trimmed. - if the category has dots, the corresponding class try to be imported. If it does not have dots, the name is looked up in builtins or __builtins__

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

nose_warnings_filters-0.0.7-py2.py3-none-any.whl (4.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file nose_warnings_filters-0.0.7-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for nose_warnings_filters-0.0.7-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4422d813924ae41f5f9111c8a6bc8481b34aced9e6e6d058612ecde02e7c7355
MD5 ced28d14782b10f18dd50813be534f36
BLAKE2b-256 f7f66911d27f7eb877b13cf7c9b05deedc1b7d8532fbc262707d000d5080b3b0

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