diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2014-02-06 22:44:27 +0200 |
|---|---|---|
| committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-02-06 22:44:27 +0200 |
| commit | af1f3216f36807fb72313f7e8490b64ae4f1b185 (patch) | |
| tree | 1f9e1a174ad3f916e02a5f4f6a960ea3a473576f /Lib/test/string_tests.py | |
| parent | af5e72d549793b85eb14c0a1658206dc918bd85b (diff) | |
| download | cpython-af1f3216f36807fb72313f7e8490b64ae4f1b185.tar.gz | |
Catch deprecation warnings emitted when non-integers are formatted with %c, %o
and %x (introduced in issue #19995).
Diffstat (limited to 'Lib/test/string_tests.py')
| -rw-r--r-- | Lib/test/string_tests.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/string_tests.py b/Lib/test/string_tests.py index ef995e202b..4345687ea1 100644 --- a/Lib/test/string_tests.py +++ b/Lib/test/string_tests.py @@ -1179,7 +1179,8 @@ class MixinStrUnicodeUserStringTest: self.checkraises(TypeError, 'abc', '__mod__') self.checkraises(TypeError, '%(foo)s', '__mod__', 42) self.checkraises(TypeError, '%s%s', '__mod__', (42,)) - self.checkraises(TypeError, '%c', '__mod__', (None,)) + with self.assertWarns(DeprecationWarning): + self.checkraises(TypeError, '%c', '__mod__', (None,)) self.checkraises(ValueError, '%(foo', '__mod__', {}) self.checkraises(TypeError, '%(foo)s %(bar)s', '__mod__', ('foo', 42)) self.checkraises(TypeError, '%d', '__mod__', "42") # not numeric |
