summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-03-12 11:15:01 (GMT)
committerGitHub <noreply@github.com>2017-03-12 11:15:01 (GMT)
commitf6595983e08fe20cf06a2535d74d912c6dbb044f (patch)
treed25d4e69e082af9db5f9cc469eabb93834b0bd7d /Lib/test
parent1989763f0d0858ce6274f5e1d725b5b8da91a780 (diff)
downloadcpython-f6595983e08fe20cf06a2535d74d912c6dbb044f.zip
cpython-f6595983e08fe20cf06a2535d74d912c6dbb044f.tar.gz
cpython-f6595983e08fe20cf06a2535d74d912c6dbb044f.tar.bz2
bpo-28692: Deprecate using non-integer value for selecting a plural form in gettext. (#507)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_gettext.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/test/test_gettext.py b/Lib/test/test_gettext.py
index a852443..7bfe747 100644
--- a/Lib/test/test_gettext.py
+++ b/Lib/test/test_gettext.py
@@ -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, [])