mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
bpo-28692: Deprecate using non-integer value for selecting a plural form in gettext. (#507)
This commit is contained in:
parent
1989763f0d
commit
f6595983e0
4 changed files with 17 additions and 3 deletions
|
@ -443,9 +443,12 @@ class PluralFormsTestCase(GettextBaseTest):
|
|||
f = gettext.c2py('n != 1')
|
||||
self.assertEqual(f(1), 0)
|
||||
self.assertEqual(f(2), 1)
|
||||
self.assertEqual(f(1.0), 0)
|
||||
self.assertEqual(f(2.0), 1)
|
||||
self.assertEqual(f(1.1), 1)
|
||||
with self.assertWarns(DeprecationWarning):
|
||||
self.assertEqual(f(1.0), 0)
|
||||
with self.assertWarns(DeprecationWarning):
|
||||
self.assertEqual(f(2.0), 1)
|
||||
with self.assertWarns(DeprecationWarning):
|
||||
self.assertEqual(f(1.1), 1)
|
||||
self.assertRaises(TypeError, f, '2')
|
||||
self.assertRaises(TypeError, f, b'2')
|
||||
self.assertRaises(TypeError, f, [])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue