Unit test fails with Python 3.8.1
See original GitHub issueRunning the unit tests with Python 3.8.1 fails with the following error:
=================================== FAILURES ===================================
_____________________________ test_bmp_characters ______________________________
def test_bmp_characters():
for index in range(0xa0, 0xfffd):
char = chr(index)
# Exclude code points that are not assigned
if unicodedata.category(char) not in ('Co', 'Cn', 'Cs', 'Mc', 'Mn', 'Sk'):
garble = char.encode('utf-8').decode('latin-1')
# Exclude characters whose re-encoding is protected by the
# 'sequence_weirdness' metric
if sequence_weirdness(garble) >= 0:
garble2 = char.encode('utf-8').decode('latin-1').encode('utf-8').decode('latin-1')
for garb in (garble, garble2):
fixed, plan = fix_encoding_and_explain(garb)
> assert fixed == char
E AssertionError: assert 'à±·' == '౷'
E - à±·
E + ౷
tests/test_characters.py:23: AssertionError
=================== 1 failed, 186 passed, 8 xfailed in 1.84s ===================
Python 3.7.6 does not produce this error.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Unit test fails with Python 3.8.1 · Issue #131 · rspeer/python-ftfy ...
Since this test only checks a character if unicodedata.category(char) not in ('Co', 'Cn', 'Cs', 'Mc', 'Mn', 'Sk') , U+0C77 is skipped in Python...
Read more >Coverage unittest fails in Python 3.8 - Stack Overflow
I am struggling with the implementation of unittest for subdirectories. I have the following project project │ README.md │ __init__.py ...
Read more >unittest — Unit testing framework — Python 3.11.1 ...
Skipping tests and expected failures¶. New in version 3.1. Unittest supports skipping individual test methods and even whole classes of tests. In addition,...
Read more >Bug #1864987 “unit tests are failing at Python 3.8 environment”
Hi, Building Rally in Debian Sid leads to a lot of unit test failures. I've attached the build log. Please consider helping me...
Read more >Unit Testing in Python -The Basics | The Startup - Medium
platform linux -- Python 3.8.1, pytest-5.4.3, py-1.9.0, pluggy-0.13.1 rootdir: /home/moose/GitHub/MartinThoma/algorithms/medium/unit-testing
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Alright, version 5.7 is uploaded.
Yep, thanks. This is a routine update we have to make to ftfy (to save the character classes from the latest Unicode that Python supports in
char_classes.dat
).