Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failures on Fedora 42 #877

Open
bkmgit opened this issue Oct 7, 2024 · 5 comments
Open

Test failures on Fedora 42 #877

bkmgit opened this issue Oct 7, 2024 · 5 comments

Comments

@bkmgit
Copy link
Contributor

bkmgit commented Oct 7, 2024

From the log:

tests/featureWriters/kernFeatureWriter2_test.py ........................ [  5%]
....F.....                                                               [  6%]
tests/featureWriters/kernFeatureWriter_test.py ......................... [  8%]
......F.....                                                             [  9%]

and

tests/featureWriters/kernFeatureWriter2_test.py ........................ [ 53%]
....F.....                                                               [ 54%]
tests/featureWriters/kernFeatureWriter_test.py ......................... [ 56%]
......F.....                                                             [ 57%]
@bkmgit
Copy link
Contributor Author

bkmgit commented Oct 7, 2024

=================================== FAILURES ===================================
_________________________ test_kern_zyyy_zinh[defcon] __________________________

snapshot = '''
lookup kern_dflt {
    lookupflag IgnoreMarks;
    pos uni0640 uni0640 0;
    pos uni0650 uni0650 1;
    pos uni06...a;
    language dflt;
    lookup kern_dflt;
    
    script dupl;
    language dflt;
    lookup kern_dflt;
} dist;

'''
FontClass = <class 'defcon.objects.font.Font'>

    def test_kern_zyyy_zinh(snapshot, FontClass):
        """Test that a sampling of glyphs with a common or inherited script, but a
        disjoint set of explicit script extensions end up in the correct lookups."""
        glyphs = {}
        for i in range(0, 0x110000, 0x10):
            script = unicodeScript(i)
            script_extension = unicodeScriptExtensions(i)
            if script not in script_extension:
                assert script in DFLT_SCRIPTS
                name = f"uni{i:04X}"
                glyphs[name] = i
        kerning = {(glyph, glyph): i for i, glyph in enumerate(glyphs)}
        ufo = makeUFO(FontClass, glyphs, None, kerning)
        newFeatures = KernFeatureWriterTest.writeFeatures(ufo)
    
>       assert newFeatures.asFea() == snapshot
E       AssertionError: assert [+ received] == [- snapshot]
E           '''
E             ...
E               lookupflag IgnoreMarks;
E         +     pos uni0300 uni0300 0;
E         +     pos uni0310 uni0310 1;
E         +     pos uni0320 uni0320 2;
E         -     pos uni0640 uni0640 0;...
E         
E         ...Full output truncated (85 lines hidden), use '-vv' to show

tests/featureWriters/kernFeatureWriter2_test.py:990: AssertionError
_________________________ test_kern_zyyy_zinh[defcon] __________________________

FontClass = <class 'defcon.objects.font.Font'>

    def test_kern_zyyy_zinh(FontClass):
        """Test that a sampling of glyphs with a common or inherited script, but a
        disjoint set of explicit script extensions end up in the correct lookups."""
        glyphs = {}
        for i in range(0, 0x110000, 0x10):
            script = unicodeScript(i)
            script_extension = unicodeScriptExtensions(i)
            if script not in script_extension:
                assert script in DFLT_SCRIPTS
                name = f"uni{i:04X}"
                glyphs[name] = i
        kerning = {(glyph, glyph): i for i, glyph in enumerate(glyphs)}
        ufo = makeUFO(FontClass, glyphs, None, kerning)
        newFeatures = KernFeatureWriterTest.writeFeatures(ufo)
    
>       assert dedent(str(newFeatures)) == dedent(
            """\
            lookup kern_Deva {
                lookupflag IgnoreMarks;
                pos uni1CD0 uni1CD0 3;
                pos uni1CE0 uni1CE0 4;
                pos uni1CF0 uni1CF0 5;
                pos uni20F0 uni20F0 7;
                pos uniA830 uniA830 28;
            } kern_Deva;
    
            lookup kern_Dupl {
                lookupflag IgnoreMarks;
                pos uni1BCA0 uni1BCA0 36;
            } kern_Dupl;
    
            lookup kern_Grek {
                lookupflag IgnoreMarks;
                pos uni1DC0 uni1DC0 6;
            } kern_Grek;
    
            lookup kern_Hani_Hrkt {
                lookupflag IgnoreMarks;
                pos uni1D360 uni1D360 37;
                pos uni1D370 uni1D370 38;
                pos uni1F250 uni1F250 39;
                pos uni3010 uni3010 8;
                pos uni3030 uni3030 9;
                pos uni30A0 uni30A0 10;
                pos uni3190 uni3190 11;
                pos uni31C0 uni31C0 12;
                pos uni31D0 uni31D0 13;
                pos uni31E0 uni31E0 14;
                pos uni3220 uni3220 15;
                pos uni3230 uni3230 16;
                pos uni3240 uni3240 17;
                pos uni3280 uni3280 18;
                pos uni3290 uni3290 19;
                pos uni32A0 uni32A0 20;
                pos uni32B0 uni32B0 21;
                pos uni32C0 uni32C0 22;
                pos uni3360 uni3360 23;
                pos uni3370 uni3370 24;
                pos uni33E0 uni33E0 25;
                pos uni33F0 uni33F0 26;
                pos uniA700 uniA700 27;
                pos uniFF70 uniFF70 29;
            } kern_Hani_Hrkt;
    
            lookup kern_Default {
                lookupflag IgnoreMarks;
                pos uni0640 uni0640 0;
                pos uni0650 uni0650 1;
                pos uni0670 uni0670 2;
                pos uni10100 uni10100 30;
                pos uni10110 uni10110 31;
                pos uni10120 uni10120 32;
                pos uni10130 uni10130 33;
                pos uni102E0 uni102E0 34;
                pos uni102F0 uni102F0 35;
            } kern_Default;
    
            feature kern {
                script DFLT;
                language dflt;
                lookup kern_Default;
                lookup kern_Grek;
                lookup kern_Hani_Hrkt;
    
                script grek;
                language dflt;
                lookup kern_Default;
                lookup kern_Grek;
    
                script hani;
                language dflt;
                lookup kern_Default;
                lookup kern_Hani_Hrkt;
    
                script kana;
                language dflt;
                lookup kern_Default;
                lookup kern_Hani_Hrkt;
            } kern;
    
            feature dist {
                script dev2;
                language dflt;
                lookup kern_Default;
                lookup kern_Deva;
    
                script deva;
                language dflt;
                lookup kern_Default;
                lookup kern_Deva;
    
                script dupl;
                language dflt;
                lookup kern_Default;
                lookup kern_Dupl;
            } dist;
            """
        )
E       AssertionError: assert 'lookup kern_...l;\n} dist;\n' == 'lookup kern_...l;\n} dist;\n'
E         
E         Skipping 61 identical leading characters in diff, use -v to show
E         - 0 uni1CD0 3;
E         ?           ^
E         + 0 uni1CD0 7;
E         ?           ^
E         -     pos uni1CE0 uni1CE0 4;...
E         
E         ...Full output truncated (218 lines hidden), use '-vv' to show

tests/featureWriters/kernFeatureWriter_test.py:1787: AssertionError
_________________________ test_kern_zyyy_zinh[ufoLib2] _________________________

snapshot = '''
lookup kern_dflt {
    lookupflag IgnoreMarks;
    pos uni0640 uni0640 0;
    pos uni0650 uni0650 1;
    pos uni06...a;
    language dflt;
    lookup kern_dflt;
    
    script dupl;
    language dflt;
    lookup kern_dflt;
} dist;

'''
FontClass = <function FontClass.<locals>.ctor at 0x7f8e40907060>

    def test_kern_zyyy_zinh(snapshot, FontClass):
        """Test that a sampling of glyphs with a common or inherited script, but a
        disjoint set of explicit script extensions end up in the correct lookups."""
        glyphs = {}
        for i in range(0, 0x110000, 0x10):
            script = unicodeScript(i)
            script_extension = unicodeScriptExtensions(i)
            if script not in script_extension:
                assert script in DFLT_SCRIPTS
                name = f"uni{i:04X}"
                glyphs[name] = i
        kerning = {(glyph, glyph): i for i, glyph in enumerate(glyphs)}
        ufo = makeUFO(FontClass, glyphs, None, kerning)
        newFeatures = KernFeatureWriterTest.writeFeatures(ufo)
    
>       assert newFeatures.asFea() == snapshot
E       AssertionError: assert [+ received] == [- snapshot]
E           '''
E             ...
E               lookupflag IgnoreMarks;
E         +     pos uni0300 uni0300 0;
E         +     pos uni0310 uni0310 1;
E         +     pos uni0320 uni0320 2;
E         -     pos uni0640 uni0640 0;...
E         
E         ...Full output truncated (85 lines hidden), use '-vv' to show

tests/featureWriters/kernFeatureWriter2_test.py:990: AssertionError
_________________________ test_kern_zyyy_zinh[ufoLib2] _________________________

FontClass = <function FontClass.<locals>.ctor at 0x7f8e40907060>

    def test_kern_zyyy_zinh(FontClass):
        """Test that a sampling of glyphs with a common or inherited script, but a
        disjoint set of explicit script extensions end up in the correct lookups."""
        glyphs = {}
        for i in range(0, 0x110000, 0x10):
            script = unicodeScript(i)
            script_extension = unicodeScriptExtensions(i)
            if script not in script_extension:
                assert script in DFLT_SCRIPTS
                name = f"uni{i:04X}"
                glyphs[name] = i
        kerning = {(glyph, glyph): i for i, glyph in enumerate(glyphs)}
        ufo = makeUFO(FontClass, glyphs, None, kerning)
        newFeatures = KernFeatureWriterTest.writeFeatures(ufo)
    
>       assert dedent(str(newFeatures)) == dedent(
            """\
            lookup kern_Deva {
                lookupflag IgnoreMarks;
                pos uni1CD0 uni1CD0 3;
                pos uni1CE0 uni1CE0 4;
                pos uni1CF0 uni1CF0 5;
                pos uni20F0 uni20F0 7;
                pos uniA830 uniA830 28;
            } kern_Deva;
    
            lookup kern_Dupl {
                lookupflag IgnoreMarks;
                pos uni1BCA0 uni1BCA0 36;
            } kern_Dupl;
    
            lookup kern_Grek {
                lookupflag IgnoreMarks;
                pos uni1DC0 uni1DC0 6;
            } kern_Grek;
    
            lookup kern_Hani_Hrkt {
                lookupflag IgnoreMarks;
                pos uni1D360 uni1D360 37;
                pos uni1D370 uni1D370 38;
                pos uni1F250 uni1F250 39;
                pos uni3010 uni3010 8;
                pos uni3030 uni3030 9;
                pos uni30A0 uni30A0 10;
                pos uni3190 uni3190 11;
                pos uni31C0 uni31C0 12;
                pos uni31D0 uni31D0 13;
                pos uni31E0 uni31E0 14;
                pos uni3220 uni3220 15;
                pos uni3230 uni3230 16;
                pos uni3240 uni3240 17;
                pos uni3280 uni3280 18;
                pos uni3290 uni3290 19;
                pos uni32A0 uni32A0 20;
                pos uni32B0 uni32B0 21;
                pos uni32C0 uni32C0 22;
                pos uni3360 uni3360 23;
                pos uni3370 uni3370 24;
                pos uni33E0 uni33E0 25;
                pos uni33F0 uni33F0 26;
                pos uniA700 uniA700 27;
                pos uniFF70 uniFF70 29;
            } kern_Hani_Hrkt;
    
            lookup kern_Default {
                lookupflag IgnoreMarks;
                pos uni0640 uni0640 0;
                pos uni0650 uni0650 1;
                pos uni0670 uni0670 2;
                pos uni10100 uni10100 30;
                pos uni10110 uni10110 31;
                pos uni10120 uni10120 32;
                pos uni10130 uni10130 33;
                pos uni102E0 uni102E0 34;
                pos uni102F0 uni102F0 35;
            } kern_Default;
    
            feature kern {
                script DFLT;
                language dflt;
                lookup kern_Default;
                lookup kern_Grek;
                lookup kern_Hani_Hrkt;
    
                script grek;
                language dflt;
                lookup kern_Default;
                lookup kern_Grek;
    
                script hani;
                language dflt;
                lookup kern_Default;
                lookup kern_Hani_Hrkt;
    
                script kana;
                language dflt;
                lookup kern_Default;
                lookup kern_Hani_Hrkt;
            } kern;
    
            feature dist {
                script dev2;
                language dflt;
                lookup kern_Default;
                lookup kern_Deva;
    
                script deva;
                language dflt;
                lookup kern_Default;
                lookup kern_Deva;
    
                script dupl;
                language dflt;
                lookup kern_Default;
                lookup kern_Dupl;
            } dist;
            """
        )
E       AssertionError: assert 'lookup kern_...l;\n} dist;\n' == 'lookup kern_...l;\n} dist;\n'
E         
E         Skipping 61 identical leading characters in diff, use -v to show
E         - 0 uni1CD0 3;
E         ?           ^
E         + 0 uni1CD0 7;
E         ?           ^
E         -     pos uni1CE0 uni1CE0 4;...
E         
E         ...Full output truncated (218 lines hidden), use '-vv' to show

tests/featureWriters/kernFeatureWriter_test.py:1787: AssertionError
=============================== warnings summary ===============================
tests/filters/dottedCircle_test.py::test_empty_font_deprecated[defcon]
  /builddir/build/BUILD/python-ufo2ft-3.3.0-build/BUILDROOT/usr/lib/python3.13/site-packages/ufo2ft/filters/dottedCircleFilter.py:8: UserWarning: The dottedCircleFilter module is deprecated, please import dottedCircle instead.
    warnings.warn(

tests/integration_test.py::IntegrationTest::test_optimizeCFF_none[defcon-cff2]
tests/integration_test.py::IntegrationTest::test_optimizeCFF_specialize[defcon-cff2]
tests/integration_test.py::IntegrationTest::test_optimizeCFF_none[ufoLib2-cff2]
tests/integration_test.py::IntegrationTest::test_optimizeCFF_specialize[ufoLib2-cff2]
  /builddir/build/BUILD/python-ufo2ft-3.3.0-build/BUILDROOT/usr/lib/python3.13/site-packages/ufo2ft/postProcessor.py:333: UserWarning: 'convertCFFtoCFF2' is deprecated; Use fontTools.cffLib.CFFToCFF2.convertCFFToCFF2 instead.
    convertCFFtoCFF2(otf)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
--------------------------- snapshot report summary ----------------------------
1 snapshot failed. 39 snapshots passed.
=========================== short test summary info ============================
FAILED tests/featureWriters/kernFeatureWriter2_test.py::test_kern_zyyy_zinh[defcon]
FAILED tests/featureWriters/kernFeatureWriter_test.py::test_kern_zyyy_zinh[defcon]
FAILED tests/featureWriters/kernFeatureWriter2_test.py::test_kern_zyyy_zinh[ufoLib2]
FAILED tests/featureWriters/kernFeatureWriter_test.py::test_kern_zyyy_zinh[ufoLib2]
========== 4 failed, 1122 passed, 8 deselected, 5 warnings in 11.90s ===========

@anthrotype
Copy link
Member

thanks.. that's weird. Can you also paste here the full list of installed requirements used by the tests?

@khaledhosny
Copy link
Collaborator

khaledhosny commented Oct 7, 2024

Should be fixed with 7a3edb2

@bkmgit
Copy link
Contributor Author

bkmgit commented Oct 9, 2024

Thanks, this works on Fedora 42, but fails on Fedora 41:
https://copr.fedorainfracloud.org/coprs/fed500/python3-ufo2ft/build/8122929/

Is it ok to disable these tests? Matching exact version requirements is tricky in a distribution.

@anthrotype
Copy link
Member

Is it ok to disable these tests?

yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants