Skip to main content

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:

$ 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

Metadata

Release files for pytest-blockage 0.2.4

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-blockage 0.2.4
File Size Uploaded
pytest-blockage-0.2.4.tar.gz 3.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-blockage 0.2.4
File Interpreter ABI Platform
pytest_blockage-0.2.4-py3-none-any.whl Python 3 none any Details

Total release size: 7.1 kB

Release files / pytest-blockage-0.2.4.tar.gz

Download URL pytest-blockage-0.2.4.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7127b9251242dfce7acce3f9f619727d06d22368249289c9cd7396134133c9a8
BLAKE2b-256 checksum
How to use checksums
582110240e4d3d94b04e0caf66164ff22ae2060483bd1d6fb935bacb5ef49ec8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

Release files / pytest_blockage-0.2.4-py3-none-any.whl

Download URL pytest_blockage-0.2.4-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b853f2259a290f079918cb886fb5f3e3fdd9e5e677d6aee60a580012daf9bf91
BLAKE2b-256 checksum
How to use checksums
fb6b8f30fd11bf57cff94079d00fb1c80661d539bfb3e5b3ffa2a8217fea69c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

Release history Release notifications | RSS feed

This release

0.2.4 This release

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

1 release file

0.1

2 release files

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