Skip to content

Commit 7b379eb

Browse files
committed
Fix pylint disables for invalid name
1 parent 76c8264 commit 7b379eb

File tree

2 files changed

+6
-34
lines changed

2 files changed

+6
-34
lines changed

tests/test_MIDIMessage_unittests.py

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@
3232

3333
# pylint: disable=invalid-name
3434
class Test_MIDIMessage_from_message_byte_tests(unittest.TestCase):
35-
# pylint: enable=invalid-name
3635
def test_NoteOn_basic(self): # pylint: disable=invalid-name
37-
# pylint: enable=invalid-name
3836
data = bytes([0x90, 0x30, 0x7F])
3937
ichannel = 0
4038

@@ -50,7 +48,6 @@ def test_NoteOn_basic(self): # pylint: disable=invalid-name
5048
self.assertEqual(msg.channel, 0)
5149

5250
def test_NoteOn_awaitingthirdbyte(self): # pylint: disable=invalid-name
53-
# pylint: enable=invalid-name
5451
data = bytes([0x90, 0x30])
5552
ichannel = 0
5653

@@ -71,7 +68,6 @@ def test_NoteOn_awaitingthirdbyte(self): # pylint: disable=invalid-name
7168
self.assertEqual(skipped, 0)
7269

7370
def test_NoteOn_predatajunk(self): # pylint: disable=invalid-name
74-
# pylint: enable=invalid-name
7571
data = bytes([0x20, 0x64, 0x90, 0x30, 0x32])
7672
ichannel = 0
7773

@@ -91,7 +87,6 @@ def test_NoteOn_predatajunk(self): # pylint: disable=invalid-name
9187
self.assertEqual(msg.channel, 0)
9288

9389
def test_NoteOn_prepartialsysex(self): # pylint: disable=invalid-name
94-
# pylint: enable=invalid-name
9590
data = bytes([0x01, 0x02, 0x03, 0x04, 0xF7, 0x90, 0x30, 0x32])
9691
ichannel = 0
9792

@@ -128,7 +123,6 @@ def test_NoteOn_prepartialsysex(self): # pylint: disable=invalid-name
128123
self.assertEqual(msg.channel, 0)
129124

130125
def test_NoteOn_postNoteOn(self): # pylint: disable=invalid-name
131-
# pylint: enable=invalid-name
132126
data = bytes([0x90 | 0x08, 0x30, 0x7F, 0x90 | 0x08, 0x37, 0x64])
133127
ichannel = 8
134128

@@ -144,7 +138,6 @@ def test_NoteOn_postNoteOn(self): # pylint: disable=invalid-name
144138
self.assertEqual(msg.channel, 8)
145139

146140
def test_NoteOn_postpartialNoteOn(self): # pylint: disable=invalid-name
147-
# pylint: enable=invalid-name
148141
data = bytes([0x90, 0x30, 0x7F, 0x90, 0x37])
149142
ichannel = 0
150143

@@ -160,7 +153,6 @@ def test_NoteOn_postpartialNoteOn(self): # pylint: disable=invalid-name
160153
self.assertEqual(msg.channel, 0)
161154

162155
def test_NoteOn_preotherchannel(self): # pylint: disable=invalid-name
163-
# pylint: enable=invalid-name
164156
data = bytes([0x90 | 0x05, 0x30, 0x7F, 0x90 | 0x03, 0x37, 0x64])
165157
ichannel = 3
166158

@@ -175,10 +167,9 @@ def test_NoteOn_preotherchannel(self): # pylint: disable=invalid-name
175167
self.assertEqual(skipped, 0)
176168
self.assertEqual(msg.channel, 3)
177169

178-
def test_NoteOn_preotherchannelplusintermediatejunk(
170+
def test_NoteOn_preotherchannelplusintermediatejunk( # pylint: disable=invalid-name
179171
self,
180-
): # pylint: disable=invalid-name
181-
# pylint: enable=invalid-name
172+
):
182173
data = bytes([0x90 | 0x05, 0x30, 0x7F, 0x00, 0x00, 0x90 | 0x03, 0x37, 0x64])
183174
ichannel = 3
184175

@@ -196,7 +187,6 @@ def test_NoteOn_preotherchannelplusintermediatejunk(
196187
self.assertEqual(msg.channel, 3)
197188

198189
def test_NoteOn_wrongchannel(self): # pylint: disable=invalid-name
199-
# pylint: enable=invalid-name
200190
data = bytes([0x95, 0x30, 0x7F])
201191
ichannel = 3
202192

@@ -209,7 +199,6 @@ def test_NoteOn_wrongchannel(self): # pylint: disable=invalid-name
209199
self.assertEqual(skipped, 0)
210200

211201
def test_NoteOn_partialandpreotherchannel1(self): # pylint: disable=invalid-name
212-
# pylint: enable=invalid-name
213202
data = bytes([0x95, 0x30, 0x7F, 0x93])
214203
ichannel = 3
215204

@@ -224,7 +213,6 @@ def test_NoteOn_partialandpreotherchannel1(self): # pylint: disable=invalid-nam
224213
self.assertEqual(skipped, 0)
225214

226215
def test_NoteOn_partialandpreotherchannel2(self): # pylint: disable=invalid-name
227-
# pylint: enable=invalid-name
228216
data = bytes([0x95, 0x30, 0x7F, 0x93, 0x37])
229217
ichannel = 3
230218

@@ -239,7 +227,6 @@ def test_NoteOn_partialandpreotherchannel2(self): # pylint: disable=invalid-nam
239227
self.assertEqual(skipped, 0)
240228

241229
def test_NoteOn_constructor_int(self): # pylint: disable=invalid-name
242-
# pylint: enable=invalid-name
243230
object1 = NoteOn(60, 0x7F)
244231

245232
self.assertEqual(object1.note, 60)
@@ -265,7 +252,6 @@ def test_NoteOn_constructor_int(self): # pylint: disable=invalid-name
265252
self.assertIsNone(object4.channel)
266253

267254
def test_SystemExclusive_NoteOn(self): # pylint: disable=invalid-name
268-
# pylint: enable=invalid-name
269255
data = bytes([0xF0, 0x42, 0x01, 0x02, 0x03, 0x04, 0xF7, 0x90 | 14, 0x30, 0x60])
270256
ichannel = 14
271257

@@ -293,10 +279,9 @@ def test_SystemExclusive_NoteOn(self): # pylint: disable=invalid-name
293279
self.assertEqual(skipped, 0)
294280
self.assertEqual(msg.channel, 14)
295281

296-
def test_SystemExclusive_NoteOn_premalterminatedsysex(
282+
def test_SystemExclusive_NoteOn_premalterminatedsysex( # pylint: disable=invalid-name
297283
self,
298-
): # pylint: disable=invalid-name
299-
# pylint: enable=invalid-name
284+
):
300285
data = bytes([0xF0, 0x42, 0x01, 0x02, 0x03, 0x04, 0xF0, 0x90, 0x30, 0x32])
301286
ichannel = 0
302287

@@ -312,7 +297,6 @@ def test_SystemExclusive_NoteOn_premalterminatedsysex(
312297
)
313298

314299
def test_Unknown_SinglebyteStatus(self): # pylint: disable=invalid-name
315-
# pylint: enable=invalid-name
316300
data = bytes([0xFD])
317301
ichannel = 0
318302

@@ -326,7 +310,6 @@ def test_Unknown_SinglebyteStatus(self): # pylint: disable=invalid-name
326310
self.assertIsNone(msg.channel)
327311

328312
def test_Empty(self): # pylint: disable=invalid-name
329-
# pylint: enable=invalid-name
330313
data = bytes([])
331314
ichannel = 0
332315

@@ -343,7 +326,6 @@ class Test_MIDIMessage_NoteOn_constructor(
343326
unittest.TestCase
344327
): # pylint: disable=invalid-name
345328
def test_NoteOn_constructor_string(self): # pylint: disable=invalid-name
346-
# pylint: enable=invalid-name
347329
object1 = NoteOn("C4", 0x64)
348330
self.assertEqual(object1.note, 60)
349331
self.assertEqual(object1.velocity, 0x64)
@@ -369,7 +351,6 @@ def test_NoteOn_constructor_valueerror3(self): # pylint: disable=invalid-name
369351
NoteOn(128, 0x7F)
370352

371353
def test_NoteOn_constructor_upperrange1(self): # pylint: disable=invalid-name
372-
# pylint: enable=invalid-name
373354
object1 = NoteOn("G9", 0x7F)
374355
self.assertEqual(object1.note, 127)
375356
self.assertEqual(object1.velocity, 0x7F)
@@ -383,12 +364,11 @@ def test_NoteOn_constructor_bogusstring(self): # pylint: disable=invalid-name
383364
NoteOn("CC4", 0x7F)
384365

385366

386-
class Test_MIDIMessage_NoteOff_constructor(
367+
class Test_MIDIMessage_NoteOff_constructor( # pylint: disable=invalid-name
387368
unittest.TestCase
388-
): # pylint: disable=invalid-name
369+
):
389370
# mostly cut and paste from NoteOn above
390371
def test_NoteOff_constructor_string(self): # pylint: disable=invalid-name
391-
# pylint: enable=invalid-name
392372
object1 = NoteOff("C4", 0x64)
393373
self.assertEqual(object1.note, 60)
394374
self.assertEqual(object1.velocity, 0x64)
@@ -418,7 +398,6 @@ def test_NoteOff_constructor_valueerror3(self): # pylint: disable=invalid-name
418398
NoteOff(128, 0x7F)
419399

420400
def test_NoteOff_constructor_upperrange1(self): # pylint: disable=invalid-name
421-
# pylint: enable=invalid-name
422401
object1 = NoteOff("G9", 0x7F)
423402
self.assertEqual(object1.note, 127)
424403
self.assertEqual(object1.velocity, 0x7F)

tests/test_MIDI_unittests.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737

3838
# For loopback/echo tests
3939
def MIDI_mocked_both_loopback(in_c, out_c): # pylint: disable=invalid-name
40-
# pylint: enable=invalid-name
4140
usb_data = bytearray()
4241

4342
def write(buffer, length):
@@ -61,7 +60,6 @@ def read(length):
6160

6261

6362
def MIDI_mocked_receive(in_c, data, read_sizes): # pylint: disable=invalid-name
64-
# pylint: enable=invalid-name
6563
usb_data = bytearray(data)
6664
chunks = read_sizes
6765
chunk_idx = 0
@@ -101,7 +99,6 @@ def test_no_inout(self):
10199
class Test_MIDI(unittest.TestCase):
102100
# pylint: disable=too-many-branches
103101
def test_captured_data_one_byte_reads(self): # pylint: disable=invalid-name
104-
# pylint: enable=invalid-name
105102
channel = 0
106103
# From an M-Audio AXIOM controller
107104
raw_data = bytearray(
@@ -173,7 +170,6 @@ def test_captured_data_one_byte_reads(self): # pylint: disable=invalid-name
173170
self.assertIsNone(msg)
174171

175172
def test_unknown_before_NoteOn(self): # pylint: disable=invalid-name
176-
# pylint: enable=invalid-name
177173
channel = 0
178174
# From an M-Audio AXIOM controller
179175
raw_data = bytes(
@@ -197,7 +193,6 @@ def test_unknown_before_NoteOn(self): # pylint: disable=invalid-name
197193

198194
# See https://github.com/adafruit/Adafruit_CircuitPython_MIDI/issues/8
199195
def test_running_status_when_implemented(self): # pylint: disable=invalid-name
200-
# pylint: enable=invalid-name
201196
channel = 8
202197
raw_data = (
203198
bytes(NoteOn("C5", 0x7F, channel=channel))
@@ -210,7 +205,6 @@ def test_running_status_when_implemented(self): # pylint: disable=invalid-name
210205
# self.assertEqual(TOFINISH, WHENIMPLEMENTED)
211206

212207
def test_somegood_somemissing_databytes(self): # pylint: disable=invalid-name
213-
# pylint: enable=invalid-name
214208
channel = 8
215209
raw_data = (
216210
bytes(NoteOn("C5", 0x7F, channel=channel))
@@ -468,7 +462,6 @@ def test_send_basic_sequences(self):
468462
nextcall += 1
469463

470464
def test_termination_with_random_data(self): # pylint: disable=invalid-name
471-
# pylint: enable=invalid-name
472465
"""Test with a random stream of bytes to ensure that the parsing code
473466
termates and returns, i.e. does not go into any infinite loops.
474467
"""

0 commit comments

Comments
 (0)