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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for fixtopt_xtofl-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7d28370b2eb5b3e4b266b7855f4cd4ffae0428414d43b64f8107f4e02948179 |
|
MD5 | 2e879c298e5d0418804db74688dd76d4 |
|
BLAKE2b-256 | a4944c2e35c89d6f80005d80f9d819baf1f037bc463babd0c9662fc14bee4396 |