question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unit test fails with Python 3.8.1

See original GitHub issue

Running 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:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rspeercommented, Feb 18, 2020

Alright, version 5.7 is uploaded.

1reaction
rspeercommented, Feb 3, 2020

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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found