From dda7ee0a56bd5441abd380a6950da1fb2ef659be Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Tue, 24 Sep 2019 15:04:07 -0400 Subject: [PATCH] Fix: bt2: use of undefined variable in _VariantFieldClassWithSelectorTestCase.test_const_append Flake8 reports: ./tests/bindings/python/bt2/test_field_class.py:875:43: F821 undefined name 'str_field_class' Fix it by defining the str_field_class variable (even though it won't actually be used). Reported-by: flake8 Change-Id: If17cef30ed24b6ec9d1ee25d3f6c94d491ffd8fd Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/2090 --- tests/bindings/python/bt2/test_field_class.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/bindings/python/bt2/test_field_class.py b/tests/bindings/python/bt2/test_field_class.py index c1a7afbc..e6380474 100644 --- a/tests/bindings/python/bt2/test_field_class.py +++ b/tests/bindings/python/bt2/test_field_class.py @@ -871,6 +871,7 @@ class _VariantFieldClassWithSelectorTestCase: def test_const_append(self): fc_const = self._create_default_const_field_class() + str_field_class = self._tc.create_string_field_class() with self.assertRaises(AttributeError): fc_const.append_option('str', str_field_class, self._ranges1) -- 2.34.1