Skip to main content

Pytest plugin for intercepting outgoing connection requests during pytest run.

Project description

Build Coverage

This package provides a plugin for pytest framework to intercept outgoing connection requests and dumps them to a file.

Installation

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

$ 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.

Config

The default dump file can be configured by specifing intercept_dump_file in the ini file or by overriding it by -o intercept_dump_file.

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

Usage

This plugin can be used by adding --remote-data=any --intercept-remote options;

NOTE: The plugin only works over functions marked with remote_data marker, see remotedata for more info.

$ pytest --remote-data=any --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.1.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytest-intercept-remote-1.1.tar.gz
  • Upload date:
  • Size: 6.9 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.1.tar.gz
Algorithm Hash digest
SHA256 1bffbc2638479b33d1f312c0912f977f897673d973d633eeb6de0a8a7dc315b6
MD5 bd1aa1aad2c6ec81fc057f1950ebbac1
BLAKE2b-256 d94d5611a1d7d7390cedf6191c793c250a7942f9485f65ba4f3922a824123400

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pytest_intercept_remote-1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b62c15a83a535bcaefe877158054932bdbf71a15ef77409f4653bbf23ddae4d4
MD5 edd0d44f6063ba9055220d929ce24a56
BLAKE2b-256 12144f3d27518bece45347e32407620ead6b083b096a120f5dadc0e9f6dbfff3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page