class_docstr: Parameterize a test case::
  
  class TestInt(object):
      @parameterized([
          ("A", 10),
          ("F", 15),
          param("10", 42, base=42)
      ])
      def test_int(self, input, expected, base=16):
          actual = int(input, base=base)
          assert_equal(actual, expected)
  
  @parameterized([
      (2, 3, 5)
      (3, 5, 8),
  ])
  def test_add(a, b, expected):
      assert_equal(a + b, expected)
class_docstr_tok: ["Parameterize","a","test","case",":",":","class","TestInt","(","object",")",":","@","parameterized","(","[","(","``","A","''",",","10",")",",","(","``","F","''",",","15",")",",","param","(","``","10","''",",","42",",","base=42",")","]",")","def","test_int","(","self",",","input",",","expected",",","base=16",")",":","actual","=","int","(","input",",","base=base",")","assert_equal","(","actual",",","expected",")","@","parameterized","(","[","(","2",",","3",",","5",")","(","3",",","5",",","8",")",",","]",")","def","test_add","(","a",",","b",",","expected",")",":","assert_equal","(","a","+","b",",","expected",")"]
docstr: A "brute force" method of parameterizing test cases. Creates new
  test cases and injects them into the namespace that the wrapped
  function is being defined in. Useful for parameterizing tests in
  subclasses of 'UnitTest', where Nose test generators don't work.
  
  >>> @parameterized.expand([("foo", 1, 2)])
  ... def test_add1(name, input, expected):
  ...     actual = add1(input)
  ...     assert_equal(actual, expected)
  ...
  >>> locals()
  ... 'test_add1_foo_0': <function ...> ...
  >>>
docstr_tok: ["A","``","brute","force","''","method","of","parameterizing","test","cases",".","Creates","new","test","cases","and","injects","them","into","the","namespace","that","the","wrapped","function","is","being","defined","in",".","Useful","for","parameterizing","tests","in","subclasses","of","'UnitTest","'",",","where","Nose","test","generators","do","n't","work",".",">",">",">","@","parameterized.expand","(","[","(","``","foo","''",",","1",",","2",")","]",")","...","def","test_add1","(","name",",","input",",","expected",")",":","...","actual","=","add1","(","input",")","...","assert_equal","(","actual",",","expected",")","...",">",">",">","locals","(",")","...","'test_add1_foo_0","'",":","<","function","...",">","...",">",">",">"]
code: def expand(cls, input, name_func=None, doc_func=None, **legacy):
      """A "brute force" method of parameterizing test cases. Creates new
      test cases and injects them into the namespace that the wrapped
      function is being defined in. Useful for parameterizing tests in
      subclasses of 'UnitTest', where Nose test generators don't work.
  
      >>> @parameterized.expand([("foo", 1, 2)])
      ... def test_add1(name, input, expected):
      ...     actual = add1(input)
      ...     assert_equal(actual, expected)
      ...
      >>> locals()
      ... 'test_add1_foo_0': <function ...> ...
      >>>
      """
  
      if "testcase_func_name" in legacy:
          warnings.warn(
              "testcase_func_name= is deprecated; use name_func=",
              DeprecationWarning,
              stacklevel=2,
          )
          if not name_func:
              name_func = legacy["testcase_func_name"]
  
      if "testcase_func_doc" in legacy:
          warnings.warn(
              "testcase_func_doc= is deprecated; use doc_func=",
              DeprecationWarning,
              stacklevel=2,
          )
          if not doc_func:
              doc_func = legacy["testcase_func_doc"]
  
      doc_func = doc_func or default_doc_func
      name_func = name_func or default_name_func
  
      def parameterized_expand_wrapper(f, instance=None):
          stack = inspect.stack()
          frame = stack[1]
          frame_locals = frame[0].f_locals
  
          parameters = cls.input_as_callable(input)()
          for num, p in enumerate(parameters):
              name = name_func(f, num, p)
              frame_locals[name] = cls.param_as_standalone_func(
                  p, f, name
              )
              frame_locals[name].__doc__ = doc_func(f, num, p)
  
          f.__test__ = False
  
      return parameterized_expand_wrapper
  
imports: import re
  import sys
  import inspect
  import warnings
  from functools import wraps
  from types import MethodType
  from collections import namedtuple
  from unittest import TestCase
label_desc: Use image node_id 8 for calling the parameterized obj's underlying member method code with example usage: obj.expand(cls, input, name_func, doc_func) and returns: parameterized_expand_wrapper