Skip to content

Commit

Permalink
chore: Remove old decorator used in tests (#73)
Browse files Browse the repository at this point in the history
It's no longer needed since the regular decorator can do the same job
  • Loading branch information
mark-koch authored Jan 3, 2024
1 parent e68c497 commit 9ac76af
Show file tree
Hide file tree
Showing 60 changed files with 59 additions and 67 deletions.
2 changes: 1 addition & 1 deletion tests/error/errors_on_usage/and_not_defined.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/errors_on_usage/else_expr_not_defined.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/errors_on_usage/else_expr_type_change.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/errors_on_usage/else_not_defined.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/errors_on_usage/else_not_defined_functional.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/errors_on_usage/else_type_change.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/errors_on_usage/else_type_change_functional.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/errors_on_usage/if_different_types.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/errors_on_usage/if_expr_cond_type_change.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/errors_on_usage/if_expr_not_defined.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/errors_on_usage/if_expr_type_change.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/errors_on_usage/if_expr_type_conflict.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/errors_on_usage/if_not_defined.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/errors_on_usage/if_not_defined_functional.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/errors_on_usage/if_type_change.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/errors_on_usage/if_type_change_functional.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/errors_on_usage/or_not_defined.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/errors_on_usage/while_new_var.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/errors_on_usage/while_new_var_functional.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/errors_on_usage/while_type_change.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/misc_errors/arg_not_annotated.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/misc_errors/functional_break.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/misc_errors/functional_continue.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/misc_errors/functional_return.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/misc_errors/nested_functional.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/misc_errors/no_return.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/misc_errors/return_not_annotated.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/misc_errors/return_not_annotated_none1.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/misc_errors/return_not_annotated_none2.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/misc_errors/undefined_var.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/misc_errors/unreachable_1.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/misc_errors/unreachable_2.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/misc_errors/unreachable_3.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/misc_errors/unreachable_4.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/misc_errors/unreachable_5.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/nested_errors/different_types_if.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/nested_errors/not_defined_if.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/nested_errors/reassign_capture_1.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/nested_errors/reassign_capture_2.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/nested_errors/reassign_capture_3.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/nested_errors/var_not_defined.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/type_errors/binary_not_arith_left.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/type_errors/binary_not_arith_right.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/type_errors/call_missing_arg.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/type_errors/call_not_function.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/type_errors/call_unexpected_arg.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/type_errors/call_wrong_arg.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/type_errors/fun_ty_mismatch_1.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from collections.abc import Callable

from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/type_errors/fun_ty_mismatch_2.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from collections.abc import Callable

from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/type_errors/fun_ty_mismatch_3.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from collections.abc import Callable

from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/type_errors/if_not_bool_functional.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/type_errors/invert_not_int.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/type_errors/return_mismatch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/type_errors/unary_not_arith.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/type_errors/unpack_not_enough.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/type_errors/unpack_too_many.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
2 changes: 1 addition & 1 deletion tests/error/type_errors/while_not_bool_functional.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from tests.error.util import guppy
from guppy.decorator import guppy


@guppy
Expand Down
8 changes: 0 additions & 8 deletions tests/error/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,10 @@
from guppy.hugr import tys
from guppy.hugr.tys import TypeBound
from guppy.module import GuppyModule
from guppy.hugr.hugr import Hugr

import guppy.decorator as decorator


def guppy(f: Callable[..., Any]) -> Hugr | None:
"""Decorator to compile functions outside of modules for testing."""
module = GuppyModule("module")
module.register_func_def(f)
return module.compile()


def run_error_test(file, capsys):
file = pathlib.Path(file)
spec = importlib.util.spec_from_file_location("test_module", file)
Expand Down

0 comments on commit 9ac76af

Please sign in to comment.