Skip to content

Instantly share code, notes, and snippets.

@tjkhara
Created October 18, 2020 16:51
Show Gist options
  • Select an option

  • Save tjkhara/f68ad1d181c7ab0a82bfdb515840d942 to your computer and use it in GitHub Desktop.

Select an option

Save tjkhara/f68ad1d181c7ab0a82bfdb515840d942 to your computer and use it in GitHub Desktop.
Fixtures - passing data
import pytest
# The text fixture and unit test are both run once for each value
# specified in the params list
@pytest.fixture(params=[1,2,3])
def setup(request):
retVal = request.param
print(f"\nSetup! retVal={retVal}")
return retVal
def test1(setup):
print(f"\n setup = {setup}")
assert True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment