mirror of
https://github.com/python/cpython.git
synced 2025-07-31 23:23:11 +00:00
Issue #7849: Now the utility `check_warnings
` verifies if the warnings are
effectively raised. A new utility ``check_py3k_warnings`` deals with py3k warnings.
This commit is contained in:
parent
1f3b4e12e8
commit
6de9e938a5
8 changed files with 102 additions and 27 deletions
|
@ -17,14 +17,11 @@ class FormatDeprecationTests(unittest.TestCase):
|
|||
PyOS_ascii_formatd = pythonapi.PyOS_ascii_formatd
|
||||
buf = create_string_buffer(' ' * 100)
|
||||
|
||||
with check_warnings() as w:
|
||||
warnings.simplefilter('default')
|
||||
with check_warnings():
|
||||
PyOS_ascii_formatd(byref(buf), sizeof(buf), '%+.10f',
|
||||
c_double(10.0))
|
||||
self.assertEqual(buf.value, '+10.0000000000')
|
||||
|
||||
self.assertEqual(w.category, DeprecationWarning)
|
||||
|
||||
class FormatTests(unittest.TestCase):
|
||||
# ensure that, for the restricted set of format codes,
|
||||
# %-formatting returns the same values os PyOS_ascii_formatd
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue