Skip to content

Commit 591ee4f

Browse files
Fix Ruff rule B018
1 parent b1ff18c commit 591ee4f

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

tfx/orchestration/mlmd_connection_manager_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def test_primary_handle(self):
4545
def test_unusable_without_enter(self):
4646
cm = mlmd_cm.MLMDConnectionManager.fake()
4747
with self.assertRaisesRegex(RuntimeError, 'not entered yet'):
48-
cm.primary_mlmd_handle # pylint: disable=pointless-statement
48+
cm.primary_mlmd_handle # noqa: B018
4949

5050
def test_enter_synced_with_handle(self):
5151
cm = mlmd_cm.MLMDConnectionManager.fake()
@@ -54,7 +54,7 @@ def test_enter_synced_with_handle(self):
5454
self.assertIsNotNone(handle.store)
5555
with self.assertRaisesRegex(
5656
RuntimeError, 'Metadata object is not in enter state'):
57-
handle.store # pylint: disable=pointless-statement
57+
handle.store # noqa: B018
5858

5959
def test_multiple_enterable(self):
6060
cm = mlmd_cm.MLMDConnectionManager.fake()
@@ -64,4 +64,4 @@ def test_multiple_enterable(self):
6464
m2 = cm.primary_mlmd_handle
6565
self.assertIs(m1, m2)
6666
with self.assertRaises(RuntimeError):
67-
cm.primary_mlmd_handle # pylint: disable=pointless-statement
67+
cm.primary_mlmd_handle # noqa: B018

tfx/types/artifact_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,10 @@ def testArtifact(self):
175175

176176
# Default property does not have span or split_names.
177177
with self.assertRaisesRegex(AttributeError, "has no property 'span'"):
178-
instance.span # pylint: disable=pointless-statement
178+
instance.span # noqa: B018
179179
with self.assertRaisesRegex(AttributeError,
180180
"has no property 'split_names'"):
181-
instance.split_names # pylint: disable=pointless-statement
181+
instance.split_names # noqa: B018
182182

183183
# Test property setters.
184184
instance.name = 'test_artifact'
@@ -1229,7 +1229,7 @@ def testArtifactProperties(self):
12291229

12301230
with self.assertRaisesRegex(AttributeError,
12311231
"Artifact has no property 'invalid'"):
1232-
my_artifact.invalid # pylint: disable=pointless-statement
1232+
my_artifact.invalid # noqa: B018
12331233

12341234
def testStringTypeNameNotAllowed(self):
12351235
with self.assertRaisesRegex(

tfx/types/value_artifact_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def testValueArtifact(self):
109109

110110
with self.assertRaisesRegex(
111111
ValueError, 'The artifact value has not yet been read from storage.'):
112-
instance.value # pylint: disable=pointless-statement
112+
instance.value # noqa: B018
113113

114114
instance.read()
115115
instance.value = _STRING_VALUE

0 commit comments

Comments
 (0)