Fix DeprecationWarning in test_bytes (GH-10805)

https://github.com/python/cpython/commit/d7a880c3c2b73415a42c8a2f900c6bc597d... commit: d7a880c3c2b73415a42c8a2f900c6bc597de115d branch: 2.7 author: Victor Stinner <vstinner@redhat.com> committer: GitHub <noreply@github.com> date: 2018-11-30T11:04:42+01:00 summary: Fix DeprecationWarning in test_bytes (GH-10805) Running test_bytes with python -3 -Wd emits two DeprecationWarning on "1/0". Use "1//0" to prevent the warning. files: M Lib/test/test_bytes.py diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index c04f7b305a0a..cb2a4d95787d 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -161,13 +161,13 @@ def test_constructor_exceptions(self): # exceptions. class BadInt: def __index__(self): - 1/0 + 1//0 self.assertRaises(ZeroDivisionError, self.type2test, BadInt()) self.assertRaises(ZeroDivisionError, self.type2test, [BadInt()]) class BadIterable: def __iter__(self): - 1/0 + 1//0 self.assertRaises(ZeroDivisionError, self.type2test, BadIterable()) def test_compare(self):
participants (1)
-
Victor Stinner