Skip to content

Commit fc57e33

Browse files
committed
[3.11] pythongh-87846: test_io: Ignore OpenWrapper in test___all__
The deprecated `OpenWrapper` is added to the module on demand in `__getattr__`, so it might or might not show up in `dir(io)` depending on whether e.g. `test_openwrapper` was run. Add in to `not_exported` so that check__all__ ignores it when it exists. This deterministically fails on some refleaks buildbots (but not when the test is re-run, so it's only marked as a warning). Locally, it can be reproduced by running `test_openwrapper` and `test__all__`, twice: ./python -m test test_io test_io -m '*test_[o_][p_][ea][nl][wl]*' -v
1 parent 8b275e7 commit fc57e33

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Lib/test/test_io.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4504,6 +4504,7 @@ class CMiscIOTest(MiscIOTest):
45044504
io = io
45054505
name_of_module = "io", "_io"
45064506
extra_exported = "BlockingIOError",
4507+
not_exported = "OpenWrapper" # deprecated, added on demand
45074508

45084509
def test_readinto_buffer_overflow(self):
45094510
# Issue #18025
@@ -4570,7 +4571,10 @@ class PyMiscIOTest(MiscIOTest):
45704571
io = pyio
45714572
name_of_module = "_pyio", "io"
45724573
extra_exported = "BlockingIOError", "open_code",
4573-
not_exported = "valid_seek_flags",
4574+
not_exported = (
4575+
"valid_seek_flags",
4576+
"OpenWrapper", # deprecated, added on demand
4577+
)
45744578

45754579

45764580
@unittest.skipIf(os.name == 'nt', 'POSIX signals required for this test.')

0 commit comments

Comments
 (0)