Skip to content
This repository was archived by the owner on Oct 6, 2025. It is now read-only.
This repository was archived by the owner on Oct 6, 2025. It is now read-only.

Lots of broken tests #40

@PureTryOut

Description

@PureTryOut

As part of packaging this for Alpine Linux to run mimic3, I'm trying to run the test suite of gruut. While some tests succeed, about half of them fail, all of them basically the same way.

________________________________________________________________ EnglishTestCase.test_times _________________________________________________________________

self = <tests.test_en.EnglishTestCase testMethod=test_times>

    def test_times(self):
        """Test expansion of times"""
        text = "4:01am and 4:01 p.m."
        sentence = next(sentences(text, lang="en_US"))
    
>       self.assertEqual(
            ["four", "oh", "one", "A", "M", "and", "four", "oh", "one", "P", "M"],
            [word.text for word in sentence],
        )
E       AssertionError: Lists differ: ['four', 'oh', 'one', 'A', 'M', 'and', 'four', 'oh', 'one', 'P', 'M'] != ['four', 'oh', 'one', 'A', 'M', 'and', 'four', 'oh', 'one', 'p', 'm']
E       
E       First differing element 9:
E       'P'
E       'p'
E       
E       - ['four', 'oh', 'one', 'A', 'M', 'and', 'four', 'oh', 'one', 'P', 'M']
E       ?                                                              ^    ^
E       
E       + ['four', 'oh', 'one', 'A', 'M', 'and', 'four', 'oh', 'one', 'p', 'm']
E       ?                                                              ^    ^

tests/test_en.py:159: AssertionError
_____________________________________________________________ EnglishTestCase.test_unclean_text _____________________________________________________________

self = <tests.test_en.EnglishTestCase testMethod=test_unclean_text>

    def test_unclean_text(self):
        """Test text with lots of noise"""
        text = (
            "IT’S <a> 'test' (seNtEnce) for-only $100, Dr., & [I] ## *like* ## it 100%!"
        )
        sentence = next(sentences(text, lang="en_US"))
    
>       self.assertEqual(
            [
                "IT'S",
                "<",
                "a",
                ">",
                "'",
                "test",
                "'",
                "(",
                "seNtEnce",
                ")",
                "for",
                "only",
                "one",
                "hundred",
                "dollars",
                ",",
                "Doctor",
                ",",
                "and",
                "[",
                "I",
                "]",
                "*",
                "like",
                "*",
                "it",
                "one",
                "hundred",
                "percent",
                "!",
            ],
            [word.text for word in sentence],
        )
E       AssertionError: Lists differ: ["IT'[70 chars]y', 'one', 'hundred', 'dollars', ',', 'Doctor'[81 chars] '!'] != ["IT'[70 chars]y', '$100', ',', 'Doctor', ',', 'and', '[', 'I[60 chars] '!']
E       
E       First differing element 12:
E       'one'
E       '$100'
E       
E       First list contains 2 additional elements.
E       First extra element 28:
E       'percent'
E       
E         ["IT'S",
E          '<',
E          'a',
E          '>',
E          "'",
E          'test',
E          "'",
E          '(',
E          'seNtEnce',
E          ')',
E          'for',
E          'only',
E       +  '$100',
E       -  'one',
E       -  'hundred',
E       -  'dollars',
E          ',',
E          'Doctor',
E          ',',
E          'and',
E          '[',
E          'I',
E          ']',
E          '*',
E          'like',
E          '*',
E          'it',
E          'one',
E          'hundred',
E          'percent',
E          '!']

tests/test_en.py:18: AssertionError
_________________________________________________________ FrenchTestCase.test_liason_adjective_noun _________________________________________________________

self = <tests.test_fr.FrenchTestCase testMethod=test_liason_adjective_noun>

    def test_liason_adjective_noun(self):
        """Test liason between adjective and noun"""
>       self._without_and_with_liason(
            "J’ai des petites oreilles.",
            "petites",
            ["p", "ə", "t", "i", "t"],
            ["p", "ə", "t", "i", "t", "z"],
        )

tests/test_fr.py:52: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_fr.py:81: in _without_and_with_liason
    self.assertEqual(word.phonemes, without_phonemes)
E   AssertionError: None != ['p', 'ə', 't', 'i', 't']

self = <tests.test_sqlite_phonemizer.PhonemizerTestCase testMethod=test_ar>

    def test_ar(self):
        """Arabic test"""
>       self.assertEqual(
            get_phonemes("حَوّامتي مُمْتِلئة", "ar"),
            [
                ("حَوَّامَتُي", ["ħ", "a", "u", "aː", "m", "t", "iː"]),
                ("مُمْتِلِئَة", ["m", "u", "m", "t", "i", "l", "i", "ʔ", "i"],),
            ],
        )
E       AssertionError: Lists differ: [] != [('حَوَّامَتُي', ['ħ', 'a', 'u', 'aː', 'm'[73 chars]i'])]
E       
E       Second list contains 2 additional elements.
E       First extra element 0:
E       ('حَوَّامَتُي', ['ħ', 'a', 'u', 'aː', 'm', 't', 'iː'])
E       
E       - []
E       + [('حَوَّامَتُي', ['ħ', 'a', 'u', 'aː', 'm', 't', 'iː']),
E       +  ('مُمْتِلِئَة', ['m', 'u', 'm', 't', 'i', 'l', 'i', 'ʔ', 'i'])]

tests/test_sqlite_phonemizer.py:16: AssertionError

More tests fail like this, but it becomes an awful big post if I paste them all 🙈

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions