diff --git a/Tests/modules/system_related/test_os.py b/Tests/modules/system_related/test_os.py index d27c6dece..1f77237d6 100644 --- a/Tests/modules/system_related/test_os.py +++ b/Tests/modules/system_related/test_os.py @@ -37,18 +37,20 @@ def test_strerror(self): elif is_osx: self.assertEqual(os.strerror(40), "Message too long") + def test_open_abplus(self): # equivalent to open(self.temp_file, "ab+"), see also test_file.test_open_abplus fd = os.open(self.temp_file, os.O_APPEND | os.O_CREAT | os.O_RDWR) try: f = open(fd, mode="ab+", closefd=False) - f.write(b"abc") - f.seek(0) - self.assertEqual(f.read(2), b"ab") - f.write(b"def") - self.assertEqual(f.read(2), b"") - f.seek(0) - self.assertEqual(f.read(6), b"abcdef") + f.raw.write(b"abcxxxx") + f.raw.seek(0) + self.assertEqual(f.raw.read(2), b"ab") + f.raw.seek(0, 2) + f.raw.write(b"def") + self.assertEqual(f.raw.read(2), b"") + f.raw.seek(0) + self.assertEqual(f.raw.read(), b"abcxxxxdef") f.close() finally: os.close(fd) diff --git a/Tests/test_dict_stdlib.py b/Tests/test_dict_stdlib.py index b20108af0..ef7318b0e 100644 --- a/Tests/test_dict_stdlib.py +++ b/Tests/test_dict_stdlib.py @@ -23,12 +23,14 @@ def load_tests(loader, standard_tests, pattern): test.test_dict.DictTest('test_oob_indexing_dictiter_iternextitem'), test.test_dict.DictTest('test_setdefault_atomic'), ] + + skip_tests = [] if is_mono: - failing_tests += [ + skip_tests += [ test.test_dict.DictTest('test_container_iterator'), # https://github.com/IronLanguages/ironpython3/issues/544 ] - return generate_suite(tests, failing_tests) + return generate_suite(tests, failing_tests, skip_tests) else: return tests diff --git a/Tests/test_file.py b/Tests/test_file.py index c40936dfc..54519f97b 100644 --- a/Tests/test_file.py +++ b/Tests/test_file.py @@ -845,14 +845,15 @@ def test_open_wbplus(self): f.seek(0) self.assertEqual(f.read(), b"abdez") + def test_open_abplus(self): with open(self.temp_file, "ab+") as f: - f.write(b"abc") - f.seek(0) - self.assertEqual(f.read(2), b"ab") - f.write(b"def") - self.assertEqual(f.read(2), b"") - f.seek(0) - self.assertEqual(f.read(6), b"abcdef") + f.raw.write(b"abc") + f.raw.seek(0) + self.assertEqual(f.raw.read(2), b"ab") + f.raw.write(b"def") + self.assertEqual(f.raw.read(2), b"") + f.raw.seek(0) + self.assertEqual(f.raw.read(6), b"abcdef") run_test(__name__)