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.2.linux-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7baa7573004d6ef9407e22bb0d4ce7e9a2b36a3165a4e70615dd8e60135e498b |
|
MD5 | 23e2758c65e915ed84fdacd15e59b43e |
|
BLAKE2b-256 | 2c8235116199176d14aeb84d4c4b8897b34dd3977962df884f331611aaf0b9a6 |
Close
Hashes for fixtopt_xtofl-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 654a27ca30519593209a3a4e0fa2d43a10c8dd0c19754f4f70b653cdc0e22e06 |
|
MD5 | 2a3ee97d536b05da7497f2b48c7c35f0 |
|
BLAKE2b-256 | 3d0a4af55b93c912094e16c0b38e94bc3b767561c13905b6faa2bf31dd5febf2 |