This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import pytest | |
@pytest.fixture | |
def random_number(request): | |
# You can set attrs on the py.test Config object whenever you want | |
# Here works, as well as any pytest hook that accepts the config arg | |
request.session.config.random_number = random.randint(0, 10000) | |
def test_random_number(random_number, request): | |
# And then they're in the config, which will be passed the the | |
# subprocess workers | |
assert request.session.config.random_number |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment