Skip to content

Commit 9d59705

Browse files
committed
Avoid BytesWarning
1 parent 321164a commit 9d59705

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Lib/test/test_string/test_templatelib.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,9 @@ def test_exhausted(self):
158158

159159
class TestFunctions(unittest.TestCase):
160160
def test_convert(self):
161-
for obj in ('Café', None, 3.14, b'bytes'):
161+
from fractions import Fraction
162+
163+
for obj in ('Café', None, 3.14, Fraction(1, 2)):
162164
with self.subTest(f'{obj=}'):
163165
self.assertEqual(convert(obj, None), obj)
164166
self.assertEqual(convert(obj, 's'), str(obj))

0 commit comments

Comments
 (0)