Skip to content

Commit 7127131

Browse files
committed
Add a test for dataclass containers with arithmetic
1 parent e0ef506 commit 7127131

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/testlib.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,15 @@ class Velocity2D:
217217
__array_ufunc__: ClassVar[None] = None
218218

219219

220+
# https://github.com/inducer/arraycontext/pull/333
221+
# (i.e. test that we consider inherited annotations)
222+
@with_container_arithmetic(bcasts_across_obj_array=True, rel_comparison=True)
223+
@dataclass_array_container
224+
@dataclass(frozen=True)
225+
class Velocity3D(Velocity2D):
226+
w: ArrayOrContainer
227+
228+
220229
@with_array_context.register(Velocity2D)
221230
# https://github.com/python/mypy/issues/13040
222231
def _with_actx_velocity_2d(ary, actx): # type: ignore[misc]

0 commit comments

Comments
 (0)