Skip to content

Instantly share code, notes, and snippets.

@poliarush
Created January 18, 2017 11:39
Show Gist options
  • Save poliarush/bc7fcc8e569313e810baebe1004e888a to your computer and use it in GitHub Desktop.
Save poliarush/bc7fcc8e569313e810baebe1004e888a to your computer and use it in GitHub Desktop.
import pytest
from random import randint
def data_generator():
# some logic
return [_ * randint(0, 10) for _ in range(10)]
class TestClass(object):
@pytest.mark.parametrize('param', data_generator())
def test_data_generator(self, param):
assert param
@pytest.mark.parametrize('param', [_ * randint(0, 10) for _ in range(10)])
def test_something(self, param):
assert param
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment