diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-08-06 23:22:08 +0300 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-08-06 23:22:08 +0300 |
commit | d73c31899e88aa5a1cc28f288cc70a35f2a196c2 (patch) | |
tree | 09d9688677f61aed77153f5fe93cccbf7975619b /Lib/test/test_posix.py | |
parent | 43b586b951aa3232261869640d379f942d0873da (diff) | |
download | cpython-git-d73c31899e88aa5a1cc28f288cc70a35f2a196c2.tar.gz |
Issue #26800: Undocumented support of general bytes-like objects
as paths in os functions is now deprecated.
Diffstat (limited to 'Lib/test/test_posix.py')
-rw-r--r-- | Lib/test/test_posix.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index 6a1c82917a..de22513e34 100644 --- a/Lib/test/test_posix.py +++ b/Lib/test/test_posix.py @@ -407,8 +407,10 @@ class PosixTester(unittest.TestCase): def test_stat(self): self.assertTrue(posix.stat(support.TESTFN)) self.assertTrue(posix.stat(os.fsencode(support.TESTFN))) - self.assertTrue(posix.stat(bytearray(os.fsencode(support.TESTFN)))) + self.assertWarnsRegex(DeprecationWarning, + 'should be string, bytes or integer, not', + posix.stat, bytearray(os.fsencode(support.TESTFN))) self.assertRaisesRegex(TypeError, 'should be string, bytes or integer, not', posix.stat, None) |