Skip to content

Commit 19a2be7

Browse files
committed
Fix unrelated pylint warnings
1 parent 5e120fd commit 19a2be7

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

tests/displayio_shared_bindings.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ def __str__(self):
211211
print(str(palette))
212212
"""
213213
out = "\nPalette:\n"
214-
for y in range(len(self.colors)):
215-
out += f" [{y}] {self.colors[y]}\n"
214+
for i, color in enumerate(self.colors):
215+
pass
216+
out += f" [{i}] {color}\n"
216217
return out

tests/test_bitmap_c_interface.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,8 @@ def test_non_zero(self):
6565

6666
def test_throws_x_out_of_range(self):
6767
b = Bitmap_C_Interface(2, 4, 1)
68-
try:
68+
with self.assertRaises(ValueError):
6969
b[2, 1] = 100
70-
self.fail("should have thrown")
71-
except ValueError:
72-
pass
7370

7471
def test_max(self):
7572
b = Bitmap_C_Interface(2, 4, 1)
@@ -78,18 +75,13 @@ def test_max(self):
7875

7976
def test_uninitialized(self):
8077
b = Bitmap_C_Interface(2, 4, 1)
81-
try:
78+
with self.assertRaises(RuntimeError):
8279
b[1, 1]
83-
self.fail("should have thrown")
84-
except RuntimeError:
85-
pass
8680

8781
def test_validate_throws(self):
8882
b = Bitmap_C_Interface(2, 4, 1)
89-
try:
83+
with self.assertRaises(ValueError):
9084
b.validate()
91-
except ValueError:
92-
pass
9385

9486
def test_repr(self):
9587
b = Bitmap_C_Interface(3, 2, 1)

0 commit comments

Comments
 (0)