Skip to content

Instantly share code, notes, and snippets.

@philangist
Created December 14, 2016 19:20
Show Gist options
  • Select an option

  • Save philangist/17d2da2025de23831ebf451234934f8b to your computer and use it in GitHub Desktop.

Select an option

Save philangist/17d2da2025de23831ebf451234934f8b to your computer and use it in GitHub Desktop.
@pytest.fixture()
def unique_parameterized_campaign(request):
def make_campaign(start_date=None, end_date=None):
campaign_parameters = {
'name': 'campaign foo',
'goal_type': 'spend',
'goal_value': 1.00,
'start_date': start_date,
'end_date': end_date,
}
campaign_id = do_sql_magic(campaign_parameters)
return campaign_id
yield make_campaign
perform_teardown_functions()
def test_expired_campaign(
unique_parameterized_campaign
):
campaign_id = unique_parameterized_campaign('2016-01-01', '2016-12-31')
do_python_magic()
assert 1 == 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment