From 4794a0823992149c1bd5cf9629b2691ed4f70a65 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Tue, 15 Oct 2019 17:13:36 -0400 Subject: [PATCH] tests: test_field.py: enable tests using _test_binop_lhs_value_same Tests using _test_binop_lhs_value_same, that make sure that using a binary operator on a field doesn't change that field's value, are currently disabled. The problem is this line, that tries to copy the field: value_before = copy.copy(self._def) Since we have removed everything related to copy of fields, this is unsupported. However, the same test but for unary operators copies the Python value instead. Change _test_binop_lhs_value_same to do the same. It's not clear to me if copying the value is really necessary, but I prefer to leave it like this at the moment. Change-Id: Ib35cbb44c000293e7e8ba42c020b5ace649a268d Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/2205 Tested-by: jenkins Reviewed-by: Francis Deslauriers --- tests/bindings/python/bt2/test_field.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/bindings/python/bt2/test_field.py b/tests/bindings/python/bt2/test_field.py index 2f4a7a76..99532e10 100644 --- a/tests/bindings/python/bt2/test_field.py +++ b/tests/bindings/python/bt2/test_field.py @@ -323,9 +323,8 @@ class _TestNumericField: # Tests that the binary operation `op`, when applied to `self._def`, # does not change its value. - @unittest.skip('copy is not implemented') def _test_binop_lhs_value_same(self, op, rhs): - value_before = copy.copy(self._def) + value_before = copy.copy(self._def_value) r, rv = self._binop(op, rhs) self.assertEqual(self._def, value_before) -- 2.34.1