Skip to content

Custom decorator for expanded tests #166

Description

@wn

I was wondering if its possible to inject decorators to expanded functions.

# this won't work
@inject_a_flag_to_setup
@parameterized.expand([1,2,3])
def foo(x):
    return x
# suggestion
@parameterized.expand([1,2,3], decorators=[inject_a_flag_to_setup])
def foo(x): 
    return x

to become

@inject_a_flag_to_setup
def foo_1_1(x):
  return x

@inject_a_flag_to_setup
def foo_2_2(x):
  return x

@inject_a_flag_to_setup
def foo_3_3(x):
  return x

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions