Skip to content

Commit b9da2ce

Browse files
committed
Update test_capi
test_capi: only run the 3 "example" tests in BytesWriterTest. There is no need to rerun the same tests in ByteArrayWriterTest.
1 parent 07185df commit b9da2ce

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

Lib/test/test_capi/test_bytes.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -384,15 +384,6 @@ def test_format_i(self):
384384
writer.format_i(b'y=%i', 456)
385385
self.assertEqual(writer.finish(), self.result_type(b'x=123, y=456'))
386386

387-
def test_example_abc(self):
388-
self.assertEqual(_testcapi.byteswriter_abc(), b'abc')
389-
390-
def test_example_resize(self):
391-
self.assertEqual(_testcapi.byteswriter_resize(), b'Hello World')
392-
393-
def test_example_highlevel(self):
394-
self.assertEqual(_testcapi.byteswriter_highlevel(), b'Hello World!')
395-
396387

397388
class BytesWriterTest(BaseWriterTest, unittest.TestCase):
398389
result_type = bytes
@@ -430,6 +421,15 @@ def test_singletons(self):
430421
writer.write_bytes(unused_text, len(unused_text))
431422
self.assertIs(writer.finish_with_size(1), singletons[ch])
432423

424+
def test_example_abc(self):
425+
self.assertEqual(_testcapi.byteswriter_abc(), b'abc')
426+
427+
def test_example_resize(self):
428+
self.assertEqual(_testcapi.byteswriter_resize(), b'Hello World')
429+
430+
def test_example_highlevel(self):
431+
self.assertEqual(_testcapi.byteswriter_highlevel(), b'Hello World!')
432+
433433

434434
class ByteArrayWriterTest(BaseWriterTest, unittest.TestCase):
435435
result_type = bytearray

0 commit comments

Comments
 (0)