Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-9372: Deprecate several __getitem__ methods #8609

Merged
merged 8 commits into from
Aug 11, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
no need to import ignore_warnings()
berkerpeksag committed Aug 2, 2018
commit cb9bc8994bb363c7e5a5fb93e5b488ff45adad9b
7 changes: 3 additions & 4 deletions Lib/test/test_fileinput.py
Original file line number Diff line number Diff line change
@@ -25,7 +25,6 @@
from pathlib import Path

from test.support import verbose, TESTFN, check_warnings
from test.support import ignore_warnings
from test.support import unlink as safe_unlink
from test import support
from unittest import mock
@@ -352,7 +351,7 @@ def test_empty_files_list_specified_to_constructor(self):
with FileInput(files=[]) as fi:
self.assertEqual(fi._files, ('-',))

@ignore_warnings(category=DeprecationWarning)
@support.ignore_warnings(category=DeprecationWarning)
def test__getitem__(self):
"""Tests invoking FileInput.__getitem__() with the current
line number"""
@@ -370,7 +369,7 @@ def test__getitem___deprecation(self):
with FileInput(files=[t]) as fi:
self.assertEqual(fi[0], "line1\n")

@ignore_warnings(category=DeprecationWarning)
@support.ignore_warnings(category=DeprecationWarning)
def test__getitem__invalid_key(self):
"""Tests invoking FileInput.__getitem__() with an index unequal to
the line number"""
@@ -380,7 +379,7 @@ def test__getitem__invalid_key(self):
fi[1]
self.assertEqual(cm.exception.args, ("accessing lines out of order",))

@ignore_warnings(category=DeprecationWarning)
@support.ignore_warnings(category=DeprecationWarning)
def test__getitem__eof(self):
"""Tests invoking FileInput.__getitem__() with the line number but at
end-of-input"""