mirror of
https://github.com/python/cpython.git
synced 2025-10-31 21:51:50 +00:00
[3.14] gh-128051: Fix tests if sys.float_repr_style is 'legacy' (GH-135908) (#136025)
gh-128051: Fix tests if sys.float_repr_style is 'legacy' (GH-135908)
(cherry picked from commit f3aec60d7a)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
a168c77536
commit
33c83cea07
16 changed files with 50 additions and 44 deletions
|
|
@ -380,7 +380,7 @@ def __new__(cls, celsius_degrees):
|
|||
return super().__new__(Temperature, celsius_degrees)
|
||||
def __repr__(self):
|
||||
kelvin_degrees = self + 273.15
|
||||
return f"{kelvin_degrees}°K"
|
||||
return f"{kelvin_degrees:.2f}°K"
|
||||
self.assertEqual(pprint.pformat(Temperature(1000)), '1273.15°K')
|
||||
|
||||
def test_sorted_dict(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue