From 4619a33db48c94f3312f31459050dbb83b1bacea Mon Sep 17 00:00:00 2001 From: occheung Date: Mon, 30 Aug 2021 13:10:02 +0800 Subject: [PATCH] test: remove broken array return tests Removed test cases that do not respect lifetime/scope constraint. See discussion in artiq-zynq repo: https://git.m-labs.hk/M-Labs/artiq-zynq/issues/119 Referred to the patch from @dnadlinger. https://github.com/dnadlinger/artiq/commit/5faa30a837790f373ab2c4063a298e2b9f818f62 --- artiq/test/coredevice/test_embedding.py | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/artiq/test/coredevice/test_embedding.py b/artiq/test/coredevice/test_embedding.py index cd8d4daab..8f5e4e3bc 100644 --- a/artiq/test/coredevice/test_embedding.py +++ b/artiq/test/coredevice/test_embedding.py @@ -261,19 +261,7 @@ class _RPCCalls(EnvExperiment): @kernel def numpy_things(self): - return (numpy.int32(10), numpy.int64(20), numpy.array([42,])) - - @kernel - def numpy_full(self): - return numpy.full(10, 20) - - @kernel - def numpy_full_matrix(self): - return numpy.full((3, 2), 13) - - @kernel - def numpy_nan(self): - return numpy.full(10, numpy.nan) + return (numpy.int32(10), numpy.int64(20)) @kernel def builtin(self): @@ -302,14 +290,11 @@ class RPCCallsTest(ExperimentCase): self.assertEqual(exp.kwargs2(), 2) self.assertEqual(exp.args1kwargs2(), 2) self.assertEqual(exp.numpy_things(), - (numpy.int32(10), numpy.int64(20), numpy.array([42,]))) + (numpy.int32(10), numpy.int64(20))) # Ensure lists of int64s don't decay to variable-length builtin integers. list_int64 = exp.list_int64() self.assertEqual(list_int64, [numpy.int64(1)]) self.assertTrue(isinstance(list_int64[0], numpy.int64)) - self.assertTrue((exp.numpy_full() == numpy.full(10, 20)).all()) - self.assertTrue((exp.numpy_full_matrix() == numpy.full((3, 2), 13)).all()) - self.assertTrue(numpy.isnan(exp.numpy_nan()).all()) exp.builtin() exp.async_in_try()