Classes | Functions | Variables
google.protobuf.internal._parameterized Namespace Reference

Classes

class  _ParameterizedTestIter
 
class  TestCase
 
class  TestGeneratorMetaclass
 

Functions

def _CleanRepr (obj)
 
def _FormatParameterList (testcase_params)
 
def _IsSingletonList (testcases)
 
def _ModifyClass (class_object, testcases, naming_type)
 
def _NonStringIterable (obj)
 
def _ParameterDecorator (naming_type, testcases)
 
def _StrClass (cls)
 
def _UpdateClassDictForParamTestCase (dct, id_suffix, name, iterator)
 
def CoopTestCase (other_base_class)
 
def named_parameters (*testcases)
 
def parameters (*testcases)
 

Variables

string __author__ = 'tmarek@google.com (Torsten Marek)'
 
 _ARGUMENT_REPR = object()
 
 _FIRST_ARG = object()
 
 _SEPARATOR = uuid.uuid1().hex
 
 ADDR_RE = re.compile(r'<([a-zA-Z0-9_\-\.]+) object at 0x[a-fA-F0-9]+>')
 

Function Documentation

◆ _CleanRepr()

def google.protobuf.internal._parameterized._CleanRepr (   obj)
private

◆ _FormatParameterList()

def google.protobuf.internal._parameterized._FormatParameterList (   testcase_params)
private

◆ _IsSingletonList()

def google.protobuf.internal._parameterized._IsSingletonList (   testcases)
private
True iff testcases contains only a single non-tuple element.

Definition at line 262 of file bloaty/third_party/protobuf/python/google/protobuf/internal/_parameterized.py.

◆ _ModifyClass()

def google.protobuf.internal._parameterized._ModifyClass (   class_object,
  testcases,
  naming_type 
)
private

◆ _NonStringIterable()

def google.protobuf.internal._parameterized._NonStringIterable (   obj)
private

◆ _ParameterDecorator()

def google.protobuf.internal._parameterized._ParameterDecorator (   naming_type,
  testcases 
)
private
Implementation of the parameterization decorators.

Args:
  naming_type: The naming type.
  testcases: Testcase parameters.

Returns:
  A function for modifying the decorated object.

Definition at line 286 of file bloaty/third_party/protobuf/python/google/protobuf/internal/_parameterized.py.

◆ _StrClass()

def google.protobuf.internal._parameterized._StrClass (   cls)
private

◆ _UpdateClassDictForParamTestCase()

def google.protobuf.internal._parameterized._UpdateClassDictForParamTestCase (   dct,
  id_suffix,
  name,
  iterator 
)
private
Adds individual test cases to a dictionary.

Args:
  dct: The target dictionary.
  id_suffix: The dictionary for mapping names to test IDs.
  name: The original name of the test case.
  iterator: The iterator generating the individual test cases.

Definition at line 372 of file bloaty/third_party/protobuf/python/google/protobuf/internal/_parameterized.py.

◆ CoopTestCase()

def google.protobuf.internal._parameterized.CoopTestCase (   other_base_class)
Returns a new base class with a cooperative metaclass base.

This enables the TestCase to be used in combination
with other base classes that have custom metaclasses, such as
mox.MoxTestBase.

Only works with metaclasses that do not override type.__new__.

Example:

  import google3
  import mox

  from google3.testing.pybase import parameterized

  class ExampleTest(parameterized.CoopTestCase(mox.MoxTestBase)):
    ...

Args:
  other_base_class: (class) A test case base class.

Returns:
  A new class object.

Definition at line 418 of file bloaty/third_party/protobuf/python/google/protobuf/internal/_parameterized.py.

◆ named_parameters()

def google.protobuf.internal._parameterized.named_parameters ( testcases)
A decorator for creating parameterized tests.

See the module docstring for a usage example. The first element of
each parameter tuple should be a string and will be appended to the
name of the test method.

Args:
  *testcases: Parameters for the decorated method, either a single
              iterable, or a list of tuples.

Returns:
   A test generator to be handled by TestGeneratorMetaclass.

Definition at line 330 of file bloaty/third_party/protobuf/python/google/protobuf/internal/_parameterized.py.

◆ parameters()

def google.protobuf.internal._parameterized.parameters ( testcases)
A decorator for creating parameterized tests.

See the module docstring for a usage example.
Args:
  *testcases: Parameters for the decorated method, either a single
              iterable, or a list of tuples/dicts/objects (for tests
              with only one argument).

Returns:
   A test generator to be handled by TestGeneratorMetaclass.

Definition at line 315 of file bloaty/third_party/protobuf/python/google/protobuf/internal/_parameterized.py.

Variable Documentation

◆ __author__

string google.protobuf.internal._parameterized.__author__ = 'tmarek@google.com (Torsten Marek)'
private

◆ _ARGUMENT_REPR

google.protobuf.internal._parameterized._ARGUMENT_REPR = object()
private

◆ _FIRST_ARG

google.protobuf.internal._parameterized._FIRST_ARG = object()
private

◆ _SEPARATOR

google.protobuf.internal._parameterized._SEPARATOR = uuid.uuid1().hex
private

◆ ADDR_RE

google.protobuf.internal._parameterized.ADDR_RE = re.compile(r'<([a-zA-Z0-9_\-\.]+) object at 0x[a-fA-F0-9]+>')


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:26