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

Tests fail in a non-UTC timezone #757

Closed
eli-schwartz opened this issue Nov 11, 2020 · 1 comment
Closed

Tests fail in a non-UTC timezone #757

eli-schwartz opened this issue Nov 11, 2020 · 1 comment
Labels

Comments

@eli-schwartz
Copy link

eli-schwartz commented Nov 11, 2020

It turns out that #747 is not the only problem running the testsuite. Trying to package the new 2.8.1 release, I discovered the tests passed on my remote build server, but failed on my laptop. I eventually pinned down the difference to the timezone in use. Exporting TZ=UTC before running the tests made it pass no matter which device I built on.

Failure log (for git master) while using TZ=EST:

=================================== FAILURES ===================================
__________ InitCatalogTestCase.test_correct_init_more_than_2_plurals ___________

self = <tests.messages.test_frontend.InitCatalogTestCase testMethod=test_correct_init_more_than_2_plurals>

        @freeze_time("1994-11-11")
        def test_correct_init_more_than_2_plurals(self):
            self.cmd.input_file = 'project/i18n/messages.pot'
            self.cmd.locale = 'lv_LV'
            self.cmd.output_dir = 'project/i18n'
    
            self.cmd.finalize_options()
            self.cmd.run()
    
            po_file = _po_file('lv_LV')
            assert os.path.isfile(po_file)
    
            expected_content = r"""# Latvian (Latvia) translations for TestProject.
    # Copyright (C) 2007 FooBar, Inc.
    # This file is distributed under the same license as the TestProject
    # project.
    # FIRST AUTHOR <EMAIL@ADDRESS>, 2007.
    #
    msgid ""
    msgstr ""
    "Project-Id-Version: TestProject 0.1\n"
    "Report-Msgid-Bugs-To: bugs.address@email.tld\n"
    "POT-Creation-Date: 2007-04-01 15:30+0200\n"
    "PO-Revision-Date: %(date)s\n"
    "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    "Language: lv_LV\n"
    "Language-Team: lv_LV <LL@li.org>\n"
    "Plural-Forms: nplurals=3; plural=(n%%10==1 && n%%100!=11 ? 0 : n != 0 ? 1 :"
    " 2)\n"
    "MIME-Version: 1.0\n"
    "Content-Type: text/plain; charset=utf-8\n"
    "Content-Transfer-Encoding: 8bit\n"
    "Generated-By: Babel %(version)s\n"
    
    #. This will be a translator coment,
    #. that will include several lines
    #: project/file1.py:8
    msgid "bar"
    msgstr ""
    
    #: project/file2.py:9
    msgid "foobar"
    msgid_plural "foobars"
    msgstr[0] ""
    msgstr[1] ""
    msgstr[2] ""
    
    """ % {'version': VERSION,
                'date': format_datetime(datetime(1994, 11, 11, 00, 00), 'yyyy-MM-dd HH:mmZ',
                                        tzinfo=LOCALTZ, locale='en')}
            with open(po_file, po_file_read_mode) as f:
                actual_content = f.read()
>           self.assertEqual(expected_content, actual_content)
E           AssertionError: '# La[346 chars]-01 15:30+0200\\n"\n"PO-Revision-Date: 1994-11[585 chars]\n\n' != '# La[346 chars]-01 19:30+0200\\n"\n"PO-Revision-Date: 1994-11[585 chars]\n\n'
E           Diff is 1128 characters long. Set self.maxDiff to None to see it.

tests/messages/test_frontend.py:541: AssertionError
_________ InitCatalogTestCase.test_correct_init_singular_plural_forms __________

self = <tests.messages.test_frontend.InitCatalogTestCase testMethod=test_correct_init_singular_plural_forms>

        @freeze_time("1994-11-11")
        def test_correct_init_singular_plural_forms(self):
            self.cmd.input_file = 'project/i18n/messages.pot'
            self.cmd.locale = 'ja_JP'
            self.cmd.output_dir = 'project/i18n'
    
            self.cmd.finalize_options()
            self.cmd.run()
    
            po_file = _po_file('ja_JP')
            assert os.path.isfile(po_file)
    
            expected_content = r"""# Japanese (Japan) translations for TestProject.
    # Copyright (C) 2007 FooBar, Inc.
    # This file is distributed under the same license as the TestProject
    # project.
    # FIRST AUTHOR <EMAIL@ADDRESS>, 2007.
    #
    msgid ""
    msgstr ""
    "Project-Id-Version: TestProject 0.1\n"
    "Report-Msgid-Bugs-To: bugs.address@email.tld\n"
    "POT-Creation-Date: 2007-04-01 15:30+0200\n"
    "PO-Revision-Date: %(date)s\n"
    "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    "Language: ja_JP\n"
    "Language-Team: ja_JP <LL@li.org>\n"
    "Plural-Forms: nplurals=1; plural=0\n"
    "MIME-Version: 1.0\n"
    "Content-Type: text/plain; charset=utf-8\n"
    "Content-Transfer-Encoding: 8bit\n"
    "Generated-By: Babel %(version)s\n"
    
    #. This will be a translator coment,
    #. that will include several lines
    #: project/file1.py:8
    msgid "bar"
    msgstr ""
    
    #: project/file2.py:9
    msgid "foobar"
    msgid_plural "foobars"
    msgstr[0] ""
    
    """ % {'version': VERSION,
                'date': format_datetime(datetime(1994, 11, 11, 00, 00), 'yyyy-MM-dd HH:mmZ',
                                        tzinfo=LOCALTZ, locale='ja_JP')}
            with open(po_file, po_file_read_mode) as f:
                actual_content = f.read()
>           self.assertEqual(expected_content, actual_content)
E           AssertionError: '# Ja[346 chars]-01 15:30+0200\\n"\n"PO-Revision-Date: 1994-11[511 chars]\n\n' != '# Ja[346 chars]-01 19:30+0200\\n"\n"PO-Revision-Date: 1994-11[511 chars]\n\n'
E           Diff is 1051 characters long. Set self.maxDiff to None to see it.

tests/messages/test_frontend.py:592: AssertionError
----------------------------- Captured stdout call -----------------------------
WARNING: msg has more translations than num_plurals of catalog
WARNING: Problem on line 28: ''
_______________ InitCatalogTestCase.test_keeps_catalog_non_fuzzy _______________

self = <tests.messages.test_frontend.InitCatalogTestCase testMethod=test_keeps_catalog_non_fuzzy>

        @freeze_time("1994-11-11")
        def test_keeps_catalog_non_fuzzy(self):
            self.cmd.input_file = 'project/i18n/messages_non_fuzzy.pot'
            self.cmd.locale = 'en_US'
            self.cmd.output_dir = 'project/i18n'
    
            self.cmd.finalize_options()
            self.cmd.run()
    
            po_file = _po_file('en_US')
            assert os.path.isfile(po_file)
    
            expected_content = r"""# English (United States) translations for TestProject.
    # Copyright (C) 2007 FooBar, Inc.
    # This file is distributed under the same license as the TestProject
    # project.
    # FIRST AUTHOR <EMAIL@ADDRESS>, 2007.
    #
    msgid ""
    msgstr ""
    "Project-Id-Version: TestProject 0.1\n"
    "Report-Msgid-Bugs-To: bugs.address@email.tld\n"
    "POT-Creation-Date: 2007-04-01 15:30+0200\n"
    "PO-Revision-Date: %(date)s\n"
    "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    "Language: en_US\n"
    "Language-Team: en_US <LL@li.org>\n"
    "Plural-Forms: nplurals=2; plural=(n != 1)\n"
    "MIME-Version: 1.0\n"
    "Content-Type: text/plain; charset=utf-8\n"
    "Content-Transfer-Encoding: 8bit\n"
    "Generated-By: Babel %(version)s\n"
    
    #. This will be a translator coment,
    #. that will include several lines
    #: project/file1.py:8
    msgid "bar"
    msgstr ""
    
    #: project/file2.py:9
    msgid "foobar"
    msgid_plural "foobars"
    msgstr[0] ""
    msgstr[1] ""
    
    """ % {'version': VERSION,
                'date': format_datetime(datetime(1994, 11, 11, 00, 00), 'yyyy-MM-dd HH:mmZ',
                                        tzinfo=LOCALTZ, locale='en')}
            with open(po_file, po_file_read_mode) as f:
                actual_content = f.read()
>           self.assertEqual(expected_content, actual_content)
E           AssertionError: '# En[353 chars]-01 15:30+0200\\n"\n"PO-Revision-Date: 1994-11[532 chars]\n\n' != '# En[353 chars]-01 19:30+0200\\n"\n"PO-Revision-Date: 1994-11[532 chars]\n\n'
E           Diff is 1080 characters long. Set self.maxDiff to None to see it.

tests/messages/test_frontend.py:487: AssertionError
__________________ InitCatalogTestCase.test_supports_no_wrap ___________________

self = <tests.messages.test_frontend.InitCatalogTestCase testMethod=test_supports_no_wrap>

        @freeze_time("1994-11-11")
        def test_supports_no_wrap(self):
            self.cmd.input_file = 'project/i18n/long_messages.pot'
            self.cmd.locale = 'en_US'
            self.cmd.output_dir = 'project/i18n'
    
            long_message = '"' + 'xxxxx ' * 15 + '"'
    
            with open('project/i18n/messages.pot', 'rb') as f:
                pot_contents = f.read().decode('latin-1')
            pot_with_very_long_line = pot_contents.replace('"bar"', long_message)
            with open(self.cmd.input_file, 'wb') as f:
                f.write(pot_with_very_long_line.encode('latin-1'))
            self.cmd.no_wrap = True
    
            self.cmd.finalize_options()
            self.cmd.run()
    
            po_file = _po_file('en_US')
            assert os.path.isfile(po_file)
            expected_content = r"""# English (United States) translations for TestProject.
    # Copyright (C) 2007 FooBar, Inc.
    # This file is distributed under the same license as the TestProject
    # project.
    # FIRST AUTHOR <EMAIL@ADDRESS>, 2007.
    #
    msgid ""
    msgstr ""
    "Project-Id-Version: TestProject 0.1\n"
    "Report-Msgid-Bugs-To: bugs.address@email.tld\n"
    "POT-Creation-Date: 2007-04-01 15:30+0200\n"
    "PO-Revision-Date: %(date)s\n"
    "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    "Language: en_US\n"
    "Language-Team: en_US <LL@li.org>\n"
    "Plural-Forms: nplurals=2; plural=(n != 1)\n"
    "MIME-Version: 1.0\n"
    "Content-Type: text/plain; charset=utf-8\n"
    "Content-Transfer-Encoding: 8bit\n"
    "Generated-By: Babel %(version)s\n"
    
    #. This will be a translator coment,
    #. that will include several lines
    #: project/file1.py:8
    msgid %(long_message)s
    msgstr ""
    
    #: project/file2.py:9
    msgid "foobar"
    msgid_plural "foobars"
    msgstr[0] ""
    msgstr[1] ""
    
    """ % {'version': VERSION,
                'date': format_datetime(datetime(1994, 11, 11, 00, 00), 'yyyy-MM-dd HH:mmZ',
                                        tzinfo=LOCALTZ, locale='en_US'),
                'long_message': long_message}
            with open(po_file, po_file_read_mode) as f:
                actual_content = f.read()
>           self.assertEqual(expected_content, actual_content)
E           AssertionError: '# En[353 chars]-01 15:30+0200\\n"\n"PO-Revision-Date: 1994-11[619 chars]\n\n' != '# En[353 chars]-01 19:30+0200\\n"\n"PO-Revision-Date: 1994-11[619 chars]\n\n'
E           Diff is 1167 characters long. Set self.maxDiff to None to see it.

tests/messages/test_frontend.py:653: AssertionError
___________________ InitCatalogTestCase.test_supports_width ____________________

self = <tests.messages.test_frontend.InitCatalogTestCase testMethod=test_supports_width>

        @freeze_time("1994-11-11")
        def test_supports_width(self):
            self.cmd.input_file = 'project/i18n/long_messages.pot'
            self.cmd.locale = 'en_US'
            self.cmd.output_dir = 'project/i18n'
    
            long_message = '"' + 'xxxxx ' * 15 + '"'
    
            with open('project/i18n/messages.pot', 'rb') as f:
                pot_contents = f.read().decode('latin-1')
            pot_with_very_long_line = pot_contents.replace('"bar"', long_message)
            with open(self.cmd.input_file, 'wb') as f:
                f.write(pot_with_very_long_line.encode('latin-1'))
            self.cmd.width = 120
            self.cmd.finalize_options()
            self.cmd.run()
    
            po_file = _po_file('en_US')
            assert os.path.isfile(po_file)
            expected_content = r"""# English (United States) translations for TestProject.
    # Copyright (C) 2007 FooBar, Inc.
    # This file is distributed under the same license as the TestProject
    # project.
    # FIRST AUTHOR <EMAIL@ADDRESS>, 2007.
    #
    msgid ""
    msgstr ""
    "Project-Id-Version: TestProject 0.1\n"
    "Report-Msgid-Bugs-To: bugs.address@email.tld\n"
    "POT-Creation-Date: 2007-04-01 15:30+0200\n"
    "PO-Revision-Date: %(date)s\n"
    "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    "Language: en_US\n"
    "Language-Team: en_US <LL@li.org>\n"
    "Plural-Forms: nplurals=2; plural=(n != 1)\n"
    "MIME-Version: 1.0\n"
    "Content-Type: text/plain; charset=utf-8\n"
    "Content-Transfer-Encoding: 8bit\n"
    "Generated-By: Babel %(version)s\n"
    
    #. This will be a translator coment,
    #. that will include several lines
    #: project/file1.py:8
    msgid %(long_message)s
    msgstr ""
    
    #: project/file2.py:9
    msgid "foobar"
    msgid_plural "foobars"
    msgstr[0] ""
    msgstr[1] ""
    
    """ % {'version': VERSION,
                'date': format_datetime(datetime(1994, 11, 11, 00, 00), 'yyyy-MM-dd HH:mmZ',
                                        tzinfo=LOCALTZ, locale='en_US'),
                'long_message': long_message}
            with open(po_file, po_file_read_mode) as f:
                actual_content = f.read()
>           self.assertEqual(expected_content, actual_content)
E           AssertionError: '# En[353 chars]-01 15:30+0200\\n"\n"PO-Revision-Date: 1994-11[619 chars]\n\n' != '# En[353 chars]-01 19:30+0200\\n"\n"PO-Revision-Date: 1994-11[619 chars]\n\n'
E           Diff is 1167 characters long. Set self.maxDiff to None to see it.

tests/messages/test_frontend.py:713: AssertionError
___________________ InitCatalogTestCase.test_with_output_dir ___________________

self = <tests.messages.test_frontend.InitCatalogTestCase testMethod=test_with_output_dir>

        @freeze_time("1994-11-11")
        def test_with_output_dir(self):
            self.cmd.input_file = 'project/i18n/messages.pot'
            self.cmd.locale = 'en_US'
            self.cmd.output_dir = 'project/i18n'
    
            self.cmd.finalize_options()
            self.cmd.run()
    
            po_file = _po_file('en_US')
            assert os.path.isfile(po_file)
    
            expected_content = r"""# English (United States) translations for TestProject.
    # Copyright (C) 2007 FooBar, Inc.
    # This file is distributed under the same license as the TestProject
    # project.
    # FIRST AUTHOR <EMAIL@ADDRESS>, 2007.
    #
    msgid ""
    msgstr ""
    "Project-Id-Version: TestProject 0.1\n"
    "Report-Msgid-Bugs-To: bugs.address@email.tld\n"
    "POT-Creation-Date: 2007-04-01 15:30+0200\n"
    "PO-Revision-Date: %(date)s\n"
    "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    "Language: en_US\n"
    "Language-Team: en_US <LL@li.org>\n"
    "Plural-Forms: nplurals=2; plural=(n != 1)\n"
    "MIME-Version: 1.0\n"
    "Content-Type: text/plain; charset=utf-8\n"
    "Content-Transfer-Encoding: 8bit\n"
    "Generated-By: Babel %(version)s\n"
    
    #. This will be a translator coment,
    #. that will include several lines
    #: project/file1.py:8
    msgid "bar"
    msgstr ""
    
    #: project/file2.py:9
    msgid "foobar"
    msgid_plural "foobars"
    msgstr[0] ""
    msgstr[1] ""
    
    """ % {'version': VERSION,
                'date': format_datetime(datetime(1994, 11, 11, 00, 00), 'yyyy-MM-dd HH:mmZ',
                                        tzinfo=LOCALTZ, locale='en')}
            with open(po_file, po_file_read_mode) as f:
                actual_content = f.read()
>           self.assertEqual(expected_content, actual_content)
E           AssertionError: '# En[353 chars]-01 15:30+0200\\n"\n"PO-Revision-Date: 1994-11[532 chars]\n\n' != '# En[353 chars]-01 19:30+0200\\n"\n"PO-Revision-Date: 1994-11[532 chars]\n\n'
E           Diff is 1080 characters long. Set self.maxDiff to None to see it.

tests/messages/test_frontend.py:435: AssertionError
_______ CommandLineInterfaceTestCase.test_init_more_than_2_plural_forms ________

self = <tests.messages.test_frontend.CommandLineInterfaceTestCase testMethod=test_init_more_than_2_plural_forms>

        @freeze_time("1994-11-11")
        def test_init_more_than_2_plural_forms(self):
            po_file = _po_file('lv_LV')
            self.cli.run(sys.argv + ['init',
                                     '--locale', 'lv_LV',
                                     '-d', i18n_dir,
                                     '-i', os.path.join(i18n_dir, 'messages.pot')])
            assert os.path.isfile(po_file)
            expected_content = r"""# Latvian (Latvia) translations for TestProject.
    # Copyright (C) 2007 FooBar, Inc.
    # This file is distributed under the same license as the TestProject
    # project.
    # FIRST AUTHOR <EMAIL@ADDRESS>, 2007.
    #
    msgid ""
    msgstr ""
    "Project-Id-Version: TestProject 0.1\n"
    "Report-Msgid-Bugs-To: bugs.address@email.tld\n"
    "POT-Creation-Date: 2007-04-01 15:30+0200\n"
    "PO-Revision-Date: %(date)s\n"
    "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    "Language: lv_LV\n"
    "Language-Team: lv_LV <LL@li.org>\n"
    "Plural-Forms: nplurals=3; plural=(n%%10==1 && n%%100!=11 ? 0 : n != 0 ? 1 :"
    " 2)\n"
    "MIME-Version: 1.0\n"
    "Content-Type: text/plain; charset=utf-8\n"
    "Content-Transfer-Encoding: 8bit\n"
    "Generated-By: Babel %(version)s\n"
    
    #. This will be a translator coment,
    #. that will include several lines
    #: project/file1.py:8
    msgid "bar"
    msgstr ""
    
    #: project/file2.py:9
    msgid "foobar"
    msgid_plural "foobars"
    msgstr[0] ""
    msgstr[1] ""
    msgstr[2] ""
    
    """ % {'version': VERSION,
                'date': format_datetime(datetime(1994, 11, 11, 00, 00), 'yyyy-MM-dd HH:mmZ',
                                        tzinfo=LOCALTZ, locale='en')}
            with open(po_file, po_file_read_mode) as f:
                actual_content = f.read()
>           self.assertEqual(expected_content, actual_content)
E           AssertionError: '# La[346 chars]-01 15:30+0200\\n"\n"PO-Revision-Date: 1994-11[585 chars]\n\n' != '# La[346 chars]-01 19:30+0200\\n"\n"PO-Revision-Date: 1994-11[585 chars]\n\n'
E           Diff is 1128 characters long. Set self.maxDiff to None to see it.

tests/messages/test_frontend.py:1113: AssertionError
------------------------------ Captured log call -------------------------------
INFO     babel:frontend.py:615 creating catalog /build/python-babel/src/babel/tests/messages/data/project/i18n/lv_LV/LC_MESSAGES/messages.po based on /build/python-babel/src/babel/tests/messages/data/project/i18n/messages.pot
_________ CommandLineInterfaceTestCase.test_init_singular_plural_forms _________

self = <tests.messages.test_frontend.CommandLineInterfaceTestCase testMethod=test_init_singular_plural_forms>

        @freeze_time("1994-11-11")
        def test_init_singular_plural_forms(self):
            po_file = _po_file('ja_JP')
            self.cli.run(sys.argv + ['init',
                                     '--locale', 'ja_JP',
                                     '-d', os.path.join(i18n_dir),
                                     '-i', os.path.join(i18n_dir, 'messages.pot')])
            assert os.path.isfile(po_file)
            expected_content = r"""# Japanese (Japan) translations for TestProject.
    # Copyright (C) 2007 FooBar, Inc.
    # This file is distributed under the same license as the TestProject
    # project.
    # FIRST AUTHOR <EMAIL@ADDRESS>, 2007.
    #
    msgid ""
    msgstr ""
    "Project-Id-Version: TestProject 0.1\n"
    "Report-Msgid-Bugs-To: bugs.address@email.tld\n"
    "POT-Creation-Date: 2007-04-01 15:30+0200\n"
    "PO-Revision-Date: %(date)s\n"
    "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    "Language: ja_JP\n"
    "Language-Team: ja_JP <LL@li.org>\n"
    "Plural-Forms: nplurals=1; plural=0\n"
    "MIME-Version: 1.0\n"
    "Content-Type: text/plain; charset=utf-8\n"
    "Content-Transfer-Encoding: 8bit\n"
    "Generated-By: Babel %(version)s\n"
    
    #. This will be a translator coment,
    #. that will include several lines
    #: project/file1.py:8
    msgid "bar"
    msgstr ""
    
    #: project/file2.py:9
    msgid "foobar"
    msgid_plural "foobars"
    msgstr[0] ""
    
    """ % {'version': VERSION,
                'date': format_datetime(datetime(1994, 11, 11, 00, 00), 'yyyy-MM-dd HH:mmZ',
                                        tzinfo=LOCALTZ, locale='en')}
            with open(po_file, po_file_read_mode) as f:
                actual_content = f.read()
>           self.assertEqual(expected_content, actual_content)
E           AssertionError: '# Ja[346 chars]-01 15:30+0200\\n"\n"PO-Revision-Date: 1994-11[511 chars]\n\n' != '# Ja[346 chars]-01 19:30+0200\\n"\n"PO-Revision-Date: 1994-11[511 chars]\n\n'
E           Diff is 1051 characters long. Set self.maxDiff to None to see it.

tests/messages/test_frontend.py:1063: AssertionError
------------------------------ Captured log call -------------------------------
INFO     babel:frontend.py:615 creating catalog /build/python-babel/src/babel/tests/messages/data/project/i18n/ja_JP/LC_MESSAGES/messages.po based on /build/python-babel/src/babel/tests/messages/data/project/i18n/messages.pot
____________ CommandLineInterfaceTestCase.test_init_with_output_dir ____________

self = <tests.messages.test_frontend.CommandLineInterfaceTestCase testMethod=test_init_with_output_dir>

        @freeze_time("1994-11-11")
        def test_init_with_output_dir(self):
            po_file = _po_file('en_US')
            self.cli.run(sys.argv + ['init',
                                     '--locale', 'en_US',
                                     '-d', os.path.join(i18n_dir),
                                     '-i', os.path.join(i18n_dir, 'messages.pot')])
            assert os.path.isfile(po_file)
            expected_content = r"""# English (United States) translations for TestProject.
    # Copyright (C) 2007 FooBar, Inc.
    # This file is distributed under the same license as the TestProject
    # project.
    # FIRST AUTHOR <EMAIL@ADDRESS>, 2007.
    #
    msgid ""
    msgstr ""
    "Project-Id-Version: TestProject 0.1\n"
    "Report-Msgid-Bugs-To: bugs.address@email.tld\n"
    "POT-Creation-Date: 2007-04-01 15:30+0200\n"
    "PO-Revision-Date: %(date)s\n"
    "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    "Language: en_US\n"
    "Language-Team: en_US <LL@li.org>\n"
    "Plural-Forms: nplurals=2; plural=(n != 1)\n"
    "MIME-Version: 1.0\n"
    "Content-Type: text/plain; charset=utf-8\n"
    "Content-Transfer-Encoding: 8bit\n"
    "Generated-By: Babel %(version)s\n"
    
    #. This will be a translator coment,
    #. that will include several lines
    #: project/file1.py:8
    msgid "bar"
    msgstr ""
    
    #: project/file2.py:9
    msgid "foobar"
    msgid_plural "foobars"
    msgstr[0] ""
    msgstr[1] ""
    
    """ % {'version': VERSION,
                'date': format_datetime(datetime(1994, 11, 11, 00, 00), 'yyyy-MM-dd HH:mmZ',
                                        tzinfo=LOCALTZ, locale='en')}
            with open(po_file, po_file_read_mode) as f:
                actual_content = f.read()
>           self.assertEqual(expected_content, actual_content)
E           AssertionError: '# En[353 chars]-01 15:30+0200\\n"\n"PO-Revision-Date: 1994-11[532 chars]\n\n' != '# En[353 chars]-01 19:30+0200\\n"\n"PO-Revision-Date: 1994-11[532 chars]\n\n'
E           Diff is 1080 characters long. Set self.maxDiff to None to see it.

tests/messages/test_frontend.py:1016: AssertionError
------------------------------ Captured log call -------------------------------
INFO     babel:frontend.py:615 creating catalog /build/python-babel/src/babel/tests/messages/data/project/i18n/en_US/LC_MESSAGES/messages.po based on /build/python-babel/src/babel/tests/messages/data/project/i18n/messages.pot
=============================== warnings summary ===============================
babel/numbers.py::babel.numbers.format_number
babel/numbers.py::babel.numbers.format_number
babel/support.py::babel.support.Format.number
tests/test_numbers.py::test_format_number
tests/test_numbers.py::test_format_number
tests/test_support.py::test_format_number
  /build/python-babel/src/babel/babel/numbers.py:352: DeprecationWarning: Use babel.numbers.format_decimal() instead.
    warnings.warn('Use babel.numbers.format_decimal() instead.', DeprecationWarning)

-- Docs: https://docs.pytest.org/en/stable/warnings.html
=========================== short test summary info ============================
FAILED tests/messages/test_frontend.py::InitCatalogTestCase::test_correct_init_more_than_2_plurals
FAILED tests/messages/test_frontend.py::InitCatalogTestCase::test_correct_init_singular_plural_forms
FAILED tests/messages/test_frontend.py::InitCatalogTestCase::test_keeps_catalog_non_fuzzy
FAILED tests/messages/test_frontend.py::InitCatalogTestCase::test_supports_no_wrap
FAILED tests/messages/test_frontend.py::InitCatalogTestCase::test_supports_width
FAILED tests/messages/test_frontend.py::InitCatalogTestCase::test_with_output_dir
FAILED tests/messages/test_frontend.py::CommandLineInterfaceTestCase::test_init_more_than_2_plural_forms
FAILED tests/messages/test_frontend.py::CommandLineInterfaceTestCase::test_init_singular_plural_forms
FAILED tests/messages/test_frontend.py::CommandLineInterfaceTestCase::test_init_with_output_dir
=========== 9 failed, 3107 passed, 18 skipped, 6 warnings in 16.30s ============
archlinux-github pushed a commit to archlinux/svntogit-community that referenced this issue Nov 11, 2020
- only change is test compat for pytest 6

- also set the timezone for the test, since it fails if you're not UTC:
  python-babel/babel#757


git-svn-id: file:///srv/repos/svn-community/svn@751201 9fca08f4-af9d-4005-b8df-a31f2cc04f65
archlinux-github pushed a commit to archlinux/svntogit-community that referenced this issue Nov 11, 2020
- only change is test compat for pytest 6

- also set the timezone for the test, since it fails if you're not UTC:
  python-babel/babel#757

git-svn-id: file:///srv/repos/svn-community/svn@751201 9fca08f4-af9d-4005-b8df-a31f2cc04f65
@akx akx added the bug label Nov 11, 2020
@akx
Copy link
Member

akx commented Jan 28, 2022

Fixed by #701.

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

No branches or pull requests

2 participants