Skip to content

Commit 837790e

Browse files
committed
fix linting
1 parent f55830c commit 837790e

1 file changed

Lines changed: 30 additions & 30 deletions

File tree

Lib/test/test_wave.py

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -552,22 +552,22 @@ def test_read_skips_unknown_chunk(self):
552552
class WaveWriteValidationTest(unittest.TestCase):
553553
"""Cover parameter-validation paths of Wave_write."""
554554

555-
@staticmethod
556-
def _close(w):
557-
try:
558-
# Make sure that all parameters are set
559-
w.setnchannels(1)
560-
w.setsampwidth(2)
561-
w.setframerate(44100)
562-
except wave.Error:
563-
# Ignore "cannot change parameters after starting to write" error
564-
pass
565-
566-
w.close()
567-
568-
def open_writer(self):
569-
w = wave.open(io.BytesIO(), 'wb')
570-
self.addCleanup(self._close, w)
555+
@staticmethod
556+
def _close(w):
557+
try:
558+
# Make sure that all parameters are set
559+
w.setnchannels(1)
560+
w.setsampwidth(2)
561+
w.setframerate(44100)
562+
except wave.Error:
563+
# Ignore "cannot change parameters after starting to write" error
564+
pass
565+
566+
w.close()
567+
568+
def open_writer(self):
569+
w = wave.open(io.BytesIO(), 'wb')
570+
self.addCleanup(self._close, w)
571571
return w
572572

573573
def test_setnchannels_rejects_nonpositive(self):
@@ -613,23 +613,23 @@ def test_getparams_incomplete(self):
613613
with self.assertRaisesRegex(wave.Error, 'not all parameters set'):
614614
w.getparams()
615615

616-
def test_tell(self):
617-
def check_nframes(nframes):
618-
self.assertEqual(w.tell(), nframes)
619-
self.assertEqual(w.getnframes(), nframes)
616+
def test_tell(self):
617+
def check_nframes(nframes):
618+
self.assertEqual(w.tell(), nframes)
619+
self.assertEqual(w.getnframes(), nframes)
620620

621-
w = self.open_writer()
622-
w.setnchannels(1)
623-
w.setsampwidth(2)
624-
w.setframerate(44100)
625-
check_nframes(0)
621+
w = self.open_writer()
622+
w.setnchannels(1)
623+
w.setsampwidth(2)
624+
w.setframerate(44100)
625+
check_nframes(0)
626626

627-
frame = b'\x00\x00'
628-
w.writeframes(frame * 5)
629-
check_nframes(5)
627+
frame = b'\x00\x00'
628+
w.writeframes(frame * 5)
629+
check_nframes(5)
630630

631-
w.writeframes(frame * 3)
632-
check_nframes(8)
631+
w.writeframes(frame * 3)
632+
check_nframes(8)
633633

634634
def test_cannot_change_params_after_write(self):
635635
w = self.open_writer()

0 commit comments

Comments
 (0)