New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pytest-blockage

Package Overview
Dependencies
Maintainers
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pytest-blockage

Disable network requests during a test run.

  • 0.2.4
  • PyPI
  • Socket score

Maintainers
3

pytest-blockage

Disable SMTP and HTTP requests during a test run.

Based mainly on https://github.com/andymckay/nose-blockage; source is available at https://github.com/rob-b/pytest-blockage

Installation

The plugin can be installed via pypi <https://pypi.python.org/pypi/pytest-blockage/>_::

$ pip install pytest-blockage

Usage

To activate the plugin the --blockage parameter should be passed. e.g.::

$ py.test package --blockage

You can whitelist specific hosts::

$ py.test package --blockage --blockage-http-whitelist=some_site --blockage-smtp-whitelist=fake_smtp

Configuration

All settings can be stored in your pytest file, with the same variable names as the argument names mentioned under usage::

blockage=true
blockage-http-whitelist=some_site
blockage-smtp-whitelist=fake_smtp

Changelog

0.2.3 (2021-12-21)

  • FIX: sdist package was broken

0.2.2 (2019-02-13)

  • FIX: SMTP whitelisting works with python3 as well

0.2.1 (2018-12-01)

  • HTTP whitelisting
  • SMTP whitelisting

0.2.0 (2015-06-22)

  • Added python 3 support

0.1 (2013-05-11)

  • Initial Release

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