From a5f5552a0a52cfd37f1db4d6df2194a4090561f5 Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 13 Jun 2018 12:47:29 +1000 Subject: [PATCH] tests/unix/extra_coverage: Don't test stream objs with NULL write fun. This behaviour of a NULL write C method on a stream that uses the write adaptor objects is no longer supported. It was only ever used by the coverage build for testing the fail path of mp_get_stream_raise(). --- ports/unix/coverage.c | 1 - tests/unix/extra_coverage.py | 6 +----- tests/unix/extra_coverage.py.exp | 1 - 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/ports/unix/coverage.c b/ports/unix/coverage.c index eba84f38b3..7820f6d736 100644 --- a/ports/unix/coverage.c +++ b/ports/unix/coverage.c @@ -118,7 +118,6 @@ STATIC mp_uint_t stest_read2(mp_obj_t o_in, void *buf, mp_uint_t size, int *errc STATIC const mp_rom_map_elem_t rawfile_locals_dict_table2[] = { { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&mp_stream_read_obj) }, - { MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&mp_stream_write_obj) }, }; STATIC MP_DEFINE_CONST_DICT(rawfile_locals_dict2, rawfile_locals_dict_table2); diff --git a/tests/unix/extra_coverage.py b/tests/unix/extra_coverage.py index 65011198dd..13721f1f47 100644 --- a/tests/unix/extra_coverage.py +++ b/tests/unix/extra_coverage.py @@ -38,11 +38,7 @@ except OSError: stream.set_error(0) print(stream.ioctl(0, bytearray(10))) # successful ioctl call -stream2 = data[3] # is textio and sets .write = NULL -try: - print(stream2.write(b'1')) # attempt to call NULL implementation -except OSError: - print('OSError') +stream2 = data[3] # is textio print(stream2.read(1)) # read 1 byte encounters non-blocking error with textio stream # test BufferedWriter with stream errors diff --git a/tests/unix/extra_coverage.py.exp b/tests/unix/extra_coverage.py.exp index 009874509d..9df8527577 100644 --- a/tests/unix/extra_coverage.py.exp +++ b/tests/unix/extra_coverage.py.exp @@ -90,7 +90,6 @@ b'123' b'123' OSError 0 -OSError None None frzstr1