Pytest extension for adding test options
Project description
fixtopt
Extend your pytests with options that can be accessed as test fixtures.
Add the options like this:
from fixtopt import Option, register
def pytest_options(parser):
register(globals(), parser, (
Option(
name="message",
default="message.txt",
help="the message file"),
Option(
name="receiver",
default="World",
help="the receiver"),
))
Import the options in your tests like you would import a fixture:
import my_mailclient
def test_a_person_receives_a_message(message, receiver):
with open(message) as f:
assert my_mailclient.receiver(f.read()) == receiver
And you can run your tests with the declared options:
pytest . --message /path/to/messagefile --receiver mrs.X
Project details
Release history Release notifications | RSS feed
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
Close
Hashes for fixtopt-xtofl-0.1.0.linux-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0bfcad57039a04dbc6325dc7188fa2321de9a69bc3cb03eab926f96b51dee196 |
|
MD5 | dc237979cf6677c0188971c3fbc2ee76 |
|
BLAKE2b-256 | def3389211d77edb1c892a134ccdb927934ebf842808598919a3cd5ea3dec38c |
Close
Hashes for fixtopt_xtofl-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e22867361c42f7fc6f0d6afa18422c1510687e8877477136832d0b97c50ea834 |
|
MD5 | caaa8b53ea77807e8a7d645efc855bee |
|
BLAKE2b-256 | cfc37503f1e0a98a5f42635dbdf8e6784dd8d44e29c8787919b24be939048e45 |