Pytest plugin for intercepting outgoing connection requests during pytest run.
Project description
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
Built Distribution
Hashes for pytest-intercept-remote-1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1bffbc2638479b33d1f312c0912f977f897673d973d633eeb6de0a8a7dc315b6 |
|
MD5 | bd1aa1aad2c6ec81fc057f1950ebbac1 |
|
BLAKE2b-256 | d94d5611a1d7d7390cedf6191c793c250a7942f9485f65ba4f3922a824123400 |
Hashes for pytest_intercept_remote-1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b62c15a83a535bcaefe877158054932bdbf71a15ef77409f4653bbf23ddae4d4 |
|
MD5 | edd0d44f6063ba9055220d929ce24a56 |
|
BLAKE2b-256 | 12144f3d27518bece45347e32407620ead6b083b096a120f5dadc0e9f6dbfff3 |