mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-109050: Remove remaining tests for legacy Unicode C API (GH-109068)
This commit is contained in:
parent
17f994174d
commit
b4131a13cb
6 changed files with 1 additions and 197 deletions
|
@ -34,7 +34,7 @@ import numbers
|
|||
import locale
|
||||
from test.support import (is_resource_enabled,
|
||||
requires_IEEE_754, requires_docstrings,
|
||||
requires_legacy_unicode_capi, check_sanitizer,
|
||||
check_sanitizer,
|
||||
check_disallow_instantiation)
|
||||
from test.support import (TestFailed,
|
||||
run_with_locale, cpython_only,
|
||||
|
@ -587,18 +587,6 @@ class ExplicitConstructionTest:
|
|||
# underscores don't prevent errors
|
||||
self.assertRaises(InvalidOperation, Decimal, "1_2_\u00003")
|
||||
|
||||
@cpython_only
|
||||
@requires_legacy_unicode_capi()
|
||||
@warnings_helper.ignore_warnings(category=DeprecationWarning)
|
||||
def test_from_legacy_strings(self):
|
||||
import _testcapi
|
||||
Decimal = self.decimal.Decimal
|
||||
context = self.decimal.Context()
|
||||
|
||||
s = _testcapi.unicode_legacy_string('9.999999')
|
||||
self.assertEqual(str(Decimal(s)), '9.999999')
|
||||
self.assertEqual(str(context.create_decimal(s)), '9.999999')
|
||||
|
||||
def test_explicit_from_tuples(self):
|
||||
Decimal = self.decimal.Decimal
|
||||
|
||||
|
@ -2919,23 +2907,6 @@ class ContextAPItests:
|
|||
assert_signals(self, c, 'traps', [InvalidOperation, DivisionByZero,
|
||||
Overflow])
|
||||
|
||||
@cpython_only
|
||||
@requires_legacy_unicode_capi()
|
||||
@warnings_helper.ignore_warnings(category=DeprecationWarning)
|
||||
def test_from_legacy_strings(self):
|
||||
import _testcapi
|
||||
c = self.decimal.Context()
|
||||
|
||||
for rnd in RoundingModes:
|
||||
c.rounding = _testcapi.unicode_legacy_string(rnd)
|
||||
self.assertEqual(c.rounding, rnd)
|
||||
|
||||
s = _testcapi.unicode_legacy_string('')
|
||||
self.assertRaises(TypeError, setattr, c, 'rounding', s)
|
||||
|
||||
s = _testcapi.unicode_legacy_string('ROUND_\x00UP')
|
||||
self.assertRaises(TypeError, setattr, c, 'rounding', s)
|
||||
|
||||
def test_pickle(self):
|
||||
|
||||
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue