diff options
author | Zackery Spytz <zspytz@gmail.com> | 2020-04-01 13:58:55 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-01 13:58:55 (GMT) |
commit | 975ac326ffe265e63a103014fd27e9d098fe7548 (patch) | |
tree | b8a86b68b758d9bf11df94b70735fe5981ed49b3 /Lib/test/test_shlex.py | |
parent | 7c72383f95b0cdedf390726069428d7b69ed2597 (diff) | |
download | cpython-975ac326ffe265e63a103014fd27e9d098fe7548.zip cpython-975ac326ffe265e63a103014fd27e9d098fe7548.tar.gz cpython-975ac326ffe265e63a103014fd27e9d098fe7548.tar.bz2 |
bpo-33262: Deprecate passing None for `s` to shlex.split() (GH-6514)
* bpo-33262: Deprecate passing None for `s` to shlex.split()
This reads the string to split from standard input.
* Update What's New.
* Fix shlex.rst
Diffstat (limited to 'Lib/test/test_shlex.py')
-rw-r--r-- | Lib/test/test_shlex.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/test_shlex.py b/Lib/test/test_shlex.py index a21ccd2..3081a78 100644 --- a/Lib/test/test_shlex.py +++ b/Lib/test/test_shlex.py @@ -3,7 +3,7 @@ import itertools import shlex import string import unittest - +from unittest import mock # The original test data set was from shellwords, by Hartmut Goebel. @@ -162,6 +162,11 @@ class ShlexTest(unittest.TestCase): tok = lex.get_token() return ret + @mock.patch('sys.stdin', io.StringIO()) + def testSplitNoneDeprecation(self): + with self.assertWarns(DeprecationWarning): + shlex.split(None) + def testSplitPosix(self): """Test data splitting with posix parser""" self.splitTest(self.posix_data, comments=True) |