Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pytest-warnings

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pytest-warnings

pytest plugin to list Python warnings in pytest report

  • 0.3.1
  • PyPI
  • Socket score

Maintainers
1

pytest-warnings

Warning

This package is inactive and will not be maintained. The functionality of this package is present in pytest <https://pypi.org/project/pytest/>_.

py.test plugin to list Python warnings in pytest report.

Integrated in pytest >= 3.1.0.

Usage

install via::

pip install pytest-warnings

if you then type::

py.test -rw

any warnings in your code are reported in the pytest report. You can use the -W option or --pythonwarnings exactly like for the python executable.

The following example ignores all warnings, but prints DeprecationWarnings once per occurrence::

py.test -rw -W ignore -W once::DeprecationWarning

You can also turn warnings into actual errors::

py.test -W error

Advance usage

You can get more fine grained filtering of warnings by using the filterwarnings configuration option.

filterwarnings works like the python's -W flag except it will not escape special characters.

Example

.. code::

# pytest.ini
[pytest]
filterwarnings= default
                ignore:.*is deprecated.*:Warning
                error::DeprecationWarning:importlib.*

Changes

0.3.0 - 2017-05-21

  • Add Travis CI config. [dwaynebailey (Dwayne Bailey)]

  • Make wheels universal. [aragilar (James Tocknell)]

  • Since this plugin is integrated in pytest 3.1.0, we show a deprecation warning and advice to uninstall the plugin. [nicoddemus (Bruno Oliveira), fschulze]

0.2.0 - 2016-10-24

  • Add filterwarnings option. [Carreau (Matthias Bussonnier)]

0.1.0 - 2016-06-27

  • Initial release. [fschulze (Florian Schulze)]

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc