module documentation

Undocumented

Class Config No class docstring; 0/8 instance variable, 0/2 class variable, 0/3 method, 1/8 class method documented
Class Variation Undocumented
Function async_test Undocumented
Function combinations Deliver multiple versions of a test based on positional combinations.
Function combinations_list As combination, but takes a single iterable
Function fixture Undocumented
Function get_current_test_name Undocumented
Function mark_base_test_class Undocumented
Function skip_test Undocumented
Function variation a helper around testing.combinations that provides a single namespace that can be used as a switch.
Function variation_fixture Undocumented
Variable add_to_marker Undocumented
Variable any_async Undocumented
Variable db Undocumented
Variable db_opts Undocumented
Variable db_url Undocumented
Variable file_config Undocumented
Variable ident Undocumented
Variable requirements Undocumented
Variable test_schema Undocumented
Variable test_schema_2 Undocumented
Class _AddToMarker Undocumented
Type Variable _FN Undocumented
Variable _current Undocumented
Variable _fixture_functions Undocumented
def async_test(fn): (source)

Undocumented

def combinations(*comb: Union[Any, Tuple[Any, ...]], argnames: Optional[str] = None, id_: Optional[str] = None, **kw: str) -> Callable[[_FN], _FN]: (source)

Deliver multiple versions of a test based on positional combinations. This is a facade over pytest.mark.parametrize. :param \*comb: argument combinations. These are tuples that will be passed positionally to the decorated function. :param argnames: optional list of argument names. These are the names of the arguments in the test function that correspond to the entries in each argument tuple. pytest.mark.parametrize requires this, however the combinations function will derive it automatically if not present by using ``inspect.getfullargspec(fn).args[1:]``. Note this assumes the first argument is "self" which is discarded. :param id\_: optional id template. This is a string template that describes how the "id" for each parameter set should be defined, if any. The number of characters in the template should match the number of entries in each argument tuple. Each character describes how the corresponding entry in the argument tuple should be handled, as far as whether or not it is included in the arguments passed to the function, as well as if it is included in the tokens used to create the id of the parameter set. If omitted, the argument combinations are passed to parametrize as is. If passed, each argument combination is turned into a pytest.param() object, mapping the elements of the argument tuple to produce an id based on a character value in the same position within the string template using the following scheme:: i - the given argument is a string that is part of the id only, don't pass it as an argument n - the given argument should be passed and it should be added to the id by calling the .__name__ attribute r - the given argument should be passed and it should be added to the id by calling repr() s - the given argument should be passed and it should be added to the id by calling str() a - (argument) the given argument should be passed and it should not be used to generated the id e.g.:: @testing.combinations( (operator.eq, "eq"), (operator.ne, "ne"), (operator.gt, "gt"), (operator.lt, "lt"), id_="na" ) def test_operator(self, opfunc, name): pass The above combination will call ``.__name__`` on the first member of each tuple and use that as the "id" to pytest.param().

def combinations_list(arg_iterable: Iterable[Tuple[Any]], **kw): (source)

As combination, but takes a single iterable

def fixture(*arg: Any, **kw: Any) -> Any: (source)

Undocumented

def get_current_test_name() -> str: (source)

Undocumented

def mark_base_test_class() -> Any: (source)

Undocumented

def skip_test(msg): (source)

Undocumented

def variation(argname, cases): (source)

a helper around testing.combinations that provides a single namespace that can be used as a switch. e.g.:: @testing.variation("querytyp", ["select", "subquery", "legacy_query"]) @testing.variation("lazy", ["select", "raise", "raise_on_sql"]) def test_thing( self, querytyp, lazy, decl_base ): class Thing(decl_base): __tablename__ = 'thing' # use name directly rel = relationship("Rel", lazy=lazy.name) # use as a switch if querytyp.select: stmt = select(Thing) elif querytyp.subquery: stmt = select(Thing).subquery() elif querytyp.legacy_query: stmt = Session.query(Thing) else: querytyp.fail() The variable provided is a slots object of boolean variables, as well as the name of the case itself under the attribute ".name"

def variation_fixture(argname, cases, scope='function'): (source)

Undocumented

add_to_marker = (source)

Undocumented

any_async: bool = (source)

Undocumented

Undocumented

Undocumented

Undocumented

file_config = (source)

Undocumented

Undocumented

requirements = (source)

Undocumented

test_schema = (source)

Undocumented

test_schema_2 = (source)

Undocumented

Undocumented

Value
TypeVar('_FN',
        bound=Callable[..., Any])
_current = (source)

Undocumented

_fixture_functions: FixtureFunctions = (source)

Undocumented