Skip to main content

A py.test plugin providing access to a dummynet.

Project description

PyPi Waf Python Tests Black Flake8

pytest-dummynet provides a py.test fixture for working with dummy-networks in pytest on Linux machines.

Installation

To install pytest-dummynet:

pip install pytest-dummynet

Usage

To make it easy to use in with pytest the DummyNet object can be injected into a test function by using the dummynet fixture.

Example:

def test_run_fail(dummynet):
    do_something(dummynet)

The dummynet argument is an instance of DummyNet and represents the dummynet environment on the machine running the test code.

Relase new version

  1. Edit NEWS.rst and wscript (set correct VERSION)

  2. Run

    ./waf upload

Source code

The main functionality is found in src/dummy_net.py and the corresponding unit test is in test/test_dummynet.py if you want to play/modify/fix the code this would, in most cases, be the place to start.

Developer Notes

We try to make our projects as independent as possible of a local system setup. For example with our native code (C/C++) we compile as much as possible from source, since this makes us independent of what is currently installed (libraries etc.) on a specific machine.

To “fetch” sources we use Waf (https://waf.io/) augmented with dependency resolution capabilities: https://github.com/steinwurf/waf

The goal is to enable a work-flow where running:

./waf configure
./waf build --run_tests

Configures, builds and runs any available tests for a given project, such that you as a developer can start hacking at the code.

For Python project this is a bit unconventional, but we think it works well.

Tests

The tests will run automatically by passing --run_tests to waf:

./waf --run_tests

This follows what seems to be “best practice” advise, namely to install the package in editable mode in a virtualenv.

Notes

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

pytest_dummynet-1.0.0-py2.py3-none-any.whl (7.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pytest_dummynet-1.0.0-py2.py3-none-any.whl.

File metadata

  • Download URL: pytest_dummynet-1.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for pytest_dummynet-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 26727942b2025cb2eaaad7ad08213cc1d8d8558dc29f514d5170cf5f880daa45
MD5 c9bfb5f8c7d611ee3f430494e4c8829a
BLAKE2b-256 cddc942d87cf7d7c3ce4e3db83e4422d56938980eb020d61d73786557741acd7

See more details on using hashes here.

Supported by

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