diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2016-08-06 23:29:29 +0300 |
|---|---|---|
| committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-08-06 23:29:29 +0300 |
| commit | febc3320563bf597e186ebce75abdac2926ceeb6 (patch) | |
| tree | 1360725b7e65af72348ed78687257249ccf1d36e /Lib/test/test_compile.py | |
| parent | d73c31899e88aa5a1cc28f288cc70a35f2a196c2 (diff) | |
| download | cpython-git-febc3320563bf597e186ebce75abdac2926ceeb6.tar.gz | |
Issue #26754: Undocumented support of general bytes-like objects
as path in compile() and similar functions is now deprecated.
Diffstat (limited to 'Lib/test/test_compile.py')
| -rw-r--r-- | Lib/test/test_compile.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index 824e843914..9638e6975a 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -473,10 +473,13 @@ if 1: self.assertEqual(d, {1: 2, 3: 4}) def test_compile_filename(self): - for filename in ('file.py', b'file.py', - bytearray(b'file.py'), memoryview(b'file.py')): + for filename in 'file.py', b'file.py': code = compile('pass', filename, 'exec') self.assertEqual(code.co_filename, 'file.py') + for filename in bytearray(b'file.py'), memoryview(b'file.py'): + with self.assertWarns(DeprecationWarning): + code = compile('pass', filename, 'exec') + self.assertEqual(code.co_filename, 'file.py') self.assertRaises(TypeError, compile, 'pass', list(b'file.py'), 'exec') @support.cpython_only |
