diff --git a/computation_graph/graph_test.py b/computation_graph/graph_test.py index 0028f67..7c7c51f 100644 --- a/computation_graph/graph_test.py +++ b/computation_graph/graph_test.py @@ -453,7 +453,7 @@ def f(x) -> int: # Bad typing! graph_runners.nullary(composers.make_compose(f, lambda: "world"), f) == "hello world" ) - assert "TypeError" in caplog.text + assert "not an instance" in caplog.text def test_type_safety_messages_no_overtrigger(caplog): diff --git a/computation_graph/run.py b/computation_graph/run.py index e01c343..3880e1e 100644 --- a/computation_graph/run.py +++ b/computation_graph/run.py @@ -56,9 +56,9 @@ def _type_check(node: base_types.ComputationNode, result): return_typing = typing.get_type_hints(node.func).get("return", None) if return_typing: try: - typeguard.check_type(str(node), result, return_typing) - except TypeError as e: - logging.error([node.func.__code__, e]) + typeguard.check_type(result, return_typing) + except typeguard.TypeCheckError as e: + logging.error([node.func.__code__, str(e)]) def _profile(node, time_started: float): diff --git a/setup.py b/setup.py index b3cd7b8..058a2f2 100644 --- a/setup.py +++ b/setup.py @@ -11,12 +11,6 @@ long_description=_LONG_DESCRIPTION, long_description_content_type="text/markdown", packages=setuptools.find_namespace_packages(), - install_requires=[ - "gamla", - "typeguard==2.13.3", - "toposort", - "immutables", - "termcolor", - ], + install_requires=["gamla", "typeguard", "toposort", "immutables", "termcolor"], extras_require={"test": ["pygraphviz", "pytest>=5.4.0"]}, )