From 7978e10441e84482d3d28e7c449d68b77c6310b6 Mon Sep 17 00:00:00 2001 From: Martin Panter Date: Sat, 16 Jan 2016 06:26:54 +0000 Subject: Issue #23883: Missing fileinput.__all__ APIs; patch by Mauro SM Rodrigues --- Lib/fileinput.py | 3 ++- Lib/test/test_fileinput.py | 8 ++++++++ Misc/ACKS | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Lib/fileinput.py b/Lib/fileinput.py index 021e39f..3543653 100644 --- a/Lib/fileinput.py +++ b/Lib/fileinput.py @@ -82,7 +82,8 @@ XXX Possible additions: import sys, os __all__ = ["input", "close", "nextfile", "filename", "lineno", "filelineno", - "isfirstline", "isstdin", "FileInput"] + "fileno", "isfirstline", "isstdin", "FileInput", "hook_compressed", + "hook_encoded"] _state = None diff --git a/Lib/test/test_fileinput.py b/Lib/test/test_fileinput.py index 91c1166..ad81304 100644 --- a/Lib/test/test_fileinput.py +++ b/Lib/test/test_fileinput.py @@ -24,6 +24,7 @@ from fileinput import FileInput, hook_encoded from test.support import verbose, TESTFN, run_unittest, check_warnings from test.support import unlink as safe_unlink +from test import support from unittest import mock @@ -913,5 +914,12 @@ class Test_hook_encoded(unittest.TestCase): check('rb', ['A\n', 'B\r\n', 'C\r', 'D\u20ac']) +class MiscTest(unittest.TestCase): + + def test_all(self): + blacklist = {'DEFAULT_BUFSIZE'} + support.check__all__(self, fileinput, blacklist=blacklist) + + if __name__ == "__main__": unittest.main() diff --git a/Misc/ACKS b/Misc/ACKS index b243181..1df5d24 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -1219,6 +1219,7 @@ Mark Roddy Kevin Rodgers Sean Rodman Giampaolo Rodola +Mauro S. M. Rodrigues Elson Rodriguez Adi Roiban Luis Rojas -- cgit v0.12