Skip to main content

Pytest plugin for intercepting outgoing connection requests during pytest run.

Project description

Python versions supported

License build Code coverage Package stability

This package provides a plugin for pytest framework for intercepting outgoing connection requests during test runs.

Installation

The pytest-intercept-remote plugin can be installed by using:

$ pip install pytest-intercept-remote

or by:

$ git clone https://github.com/devanshshukla99/pytest-intercept-remote
$ cd pytest-intercept-remote
$ pip install .

The plugin will register automatically with pytest framework and will be ready to use.

Configuration

The default dump file is .intercepted which can be overridden by:

  • either specifing intercept_dump_file in the ini file

  • or by adding -o intercept_dump_file=[dump file] option

$ pytest --intercept-remote -o intercept_dump_file=urls.json

Usage

The urls can be intercepted using --intercept-remote option;

$ pytest --intercept-remote

The tests trying to connect to internet will xfail.

Testing

Use tox to make sure the plugin is working:

$ git clone https://github.com/devanshshukla99/pytest-intercept-remote
$ cd pytest-intercept-remote
$ tox -e py38

See tox for more info.

Licence

This plugin is licenced under a 3-clause BSD style licence - see the LICENCE file.

Project details


Download files

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

Source Distribution

pytest-intercept-remote-1.2.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

pytest_intercept_remote-1.2-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file pytest-intercept-remote-1.2.tar.gz.

File metadata

  • Download URL: pytest-intercept-remote-1.2.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10

File hashes

Hashes for pytest-intercept-remote-1.2.tar.gz
Algorithm Hash digest
SHA256 7595edb62b45cd79111dc89d9492d6db6c3a29c2b619c6c586d06ccbda86ce92
MD5 2d0f353110650a3f4c87ca306210b37c
BLAKE2b-256 3dbc064b33382f6e605e4efa8db40b65e6c01e035db89a4a5fa7f1c97db65bcc

See more details on using hashes here.

File details

Details for the file pytest_intercept_remote-1.2-py3-none-any.whl.

File metadata

  • Download URL: pytest_intercept_remote-1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10

File hashes

Hashes for pytest_intercept_remote-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f535de27d5fffe30262f02a62d2a01f0c42ecdb35258221a58bba5b24bbe05f5
MD5 77b3d83722d5504902eaa2c3d75902c8
BLAKE2b-256 c94bb6fb65357f328ddfdbbedf404e35b108a0eb7ebe675136a3dd67ee184b6d

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