Public Member Functions | Static Public Member Functions | List of all members
mox.MoxMetaTestBase Class Reference
Inheritance diagram for mox.MoxMetaTestBase:
Inheritance graph
[legend]

Public Member Functions

def __init__ (cls, name, bases, d)
 
def __init__ (cls, name, bases, d)
 

Static Public Member Functions

def CleanUpTest (cls, func)
 
def CleanUpTest (cls, func)
 

Detailed Description

Metaclass to add mox cleanup and verification to every test.

As the mox unit testing class is being constructed (MoxTestBase or a
subclass), this metaclass will modify all test functions to call the
CleanUpMox method of the test class after they finish. This means that
unstubbing and verifying will happen for every test with no additional code,
and any failures will result in test failures as opposed to errors.

Definition at line 1334 of file bloaty/third_party/protobuf/python/mox.py.

Constructor & Destructor Documentation

◆ __init__() [1/2]

def mox.MoxMetaTestBase.__init__ (   cls,
  name,
  bases,
  d 
)

Definition at line 1344 of file bloaty/third_party/protobuf/python/mox.py.

◆ __init__() [2/2]

def mox.MoxMetaTestBase.__init__ (   cls,
  name,
  bases,
  d 
)

Definition at line 1344 of file protobuf/python/mox.py.

Member Function Documentation

◆ CleanUpTest() [1/2]

def mox.MoxMetaTestBase.CleanUpTest (   cls,
  func 
)
static
Adds Mox cleanup code to any MoxTestBase method.

Always unsets stubs after a test. Will verify all mocks for tests that
otherwise pass.

Args:
  cls: MoxTestBase or subclass; the class whose test method we are altering.
  func: method; the method of the MoxTestBase test class we wish to alter.

Returns:
  The modified method.

Definition at line 1358 of file bloaty/third_party/protobuf/python/mox.py.

◆ CleanUpTest() [2/2]

def mox.MoxMetaTestBase.CleanUpTest (   cls,
  func 
)
static
Adds Mox cleanup code to any MoxTestBase method.

Always unsets stubs after a test. Will verify all mocks for tests that
otherwise pass.

Args:
  cls: MoxTestBase or subclass; the class whose test method we are altering.
  func: method; the method of the MoxTestBase test class we wish to alter.

Returns:
  The modified method.

Definition at line 1358 of file protobuf/python/mox.py.


The documentation for this class was generated from the following file:


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