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.0.1.linux-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83f462f88bcf5834992cd386bb505bc077343e0b085dbc2bb3f0e18328bceb30 |
|
MD5 | 864db916e6ab7f5b2647eac90018c805 |
|
BLAKE2b-256 | d27839692660139fb1affee6993dd30b30ceb30a8b4a6612dba085f093989d0e |
Close
Hashes for fixtopt_xtofl-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6994f59c3134c98568473e1ac8fc7adda6e0a639a30557b163464d98273f0ef |
|
MD5 | d2f995dc147229977d60cbe7ae9afc25 |
|
BLAKE2b-256 | ac317367259ee1baa3fdf65d80c77658c00b994f07828aefbdc520d807ec85fc |