def test_disable_type_check(self, graph_with_incompatible_types): """ ensure digraph that have incompatible types are valid when type checking is disabled. """ with spype.options(check_type=False): try: graph_with_incompatible_types.validate() except InvalidPype: pytest.fail("should not fail when type checking is turned off")
def test_print(self, capsys, joined_pypes): """ ensure the outputs are printed when told to do so """ joined_pypes(2) with spype.options(print_flow=True): joined_pypes(2) out, err = capsys.readouterr() assert 'got' in out assert 'and returned' in out
def test_disable_compat_check(self, graph_with_incompatible_arg_numbers): """ ensure compat. checks can be disabled """ # ensure global options can disable compat check graph: _WrapDiGraph = graph_with_incompatible_arg_numbers with spype.options(check_compatibility=False): try: graph.validate() except InvalidPype: pytest.fail("should not fail when type checking is turned off") # ensure the validate call can disable compat check try: graph.validate(check_task_compatibility=False) except InvalidPype: pytest.fail("should not raise")
def test_bad_type_doesnt_raise(self, plus_one): """ make sure the bad type doesnt raise when type-checking is disabled """ with spype.options(check_type=False): plus_one.run(1.1)
def ensure_type_check_is_on(self): """ ensure type checking is on for task input/ouput for this suite of tests """ with spype.options(check_type=True): yield