From 46c7896c99050091526d03ef2558e24fdd2886d3 Mon Sep 17 00:00:00 2001 From: Patrick Kidger <33688385+patrick-kidger@users.noreply.github.com> Date: Wed, 19 Apr 2023 11:48:08 -0700 Subject: [PATCH] Transitive test now uses typeguard instead of beartype --- .../another_file.py | 19 ++++++++++--------- test/test_import_hook.py | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/test/import_hook_tester_transitive/another_file.py b/test/import_hook_tester_transitive/another_file.py index a9cfb0b..c4fc46d 100644 --- a/test/import_hook_tester_transitive/another_file.py +++ b/test/import_hook_tester_transitive/another_file.py @@ -17,7 +17,6 @@ # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -import equinox as eqx import jax.numpy as jnp import pytest @@ -35,13 +34,15 @@ with pytest.raises(ParamError): g(jnp.array(1)) -class M(eqx.Module): - foo: int - bar: Float32[jnp.ndarray, " a"] +# Typeguard 3.0 no longer supports this +# +# class M(eqx.Module): +# foo: int +# bar: Float32[jnp.ndarray, " a"] -M(1, jnp.array([1.0])) -with pytest.raises(ParamError): - M(1.0, jnp.array([1.0])) -with pytest.raises(ParamError): - M(1, jnp.array(1.0)) +# M(1, jnp.array([1.0])) +# with pytest.raises(ParamError): +# M(1.0, jnp.array([1.0])) +# with pytest.raises(ParamError): +# M(1, jnp.array(1.0)) diff --git a/test/test_import_hook.py b/test/test_import_hook.py index cff30df..9f35fe4 100644 --- a/test/test_import_hook.py +++ b/test/test_import_hook.py @@ -78,7 +78,7 @@ def test_import_hook_beartype_full(): def test_import_hook_transitive(): hook = install_import_hook( - "test.import_hook_tester_transitive", "beartype.beartype" + "test.import_hook_tester_transitive", "typeguard.typechecked" ) with hook: from . import import_hook_tester_transitive # noqa: F401