We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7f3320f commit fd984dcCopy full SHA for fd984dc
1 file changed
tests/test_testing.py
@@ -350,9 +350,19 @@ def f(self, y: Array) -> Array:
350
lazy_xp_function((B, "g"))
351
352
353
-def test_lazy_xp_function_class_inheritance():
354
- assert hasattr(B.g, "_lazy_xp_function")
355
- assert not hasattr(A.g, "_lazy_xp_function")
+class TestLazyXpFunctionClasses:
+ def test_parent_method_not_tagged(self):
+ assert hasattr(B.g, "_lazy_xp_function")
356
+ assert not hasattr(A.g, "_lazy_xp_function")
357
+
358
+ def test_lazy_xp_function_classes(self, xp):
359
+ x = xp.asarray([1.1, 2.2, 3.3])
360
+ y = xp.asarray([1.0, 2.0, 3.0])
361
+ z = xp.asarray([3.0, 4.0, 5.0])
362
+ foo = B(x)
363
+ observed = foo.g(y, z)
364
+ expected = xp.asarray(44.0)[()]
365
+ xp_assert_close(observed, expected)
366
367
368
def dask_raises(x: Array) -> Array:
0 commit comments