Giter Site home page Giter Site logo

pytest-translations's Introduction

version ci coverage license

PyTest Translations

A py.test plugin to check gettext po & mo files.

Test check for:

  • Spelling (using enchant & aspell)
  • Consistency of mo files
  • Obsolete translations
  • Fuzzy translations

Installation

Install the PyPi package.

pip install pytest-translations

The spell checking requires enchant and aspell including the correct dictionary.

On Linux simply install:

sudo apt-get install python3-enchant python-enchant aspell-{en|de|CHOSE YOUR LANGUAGE CODES}

To set up travis-ci simply add the apt packages to your travis-ci config YAML:

addons:
  apt:
    packages:
    - python-enchant
    - python3-enchant
    - aspell-en
    - aspell-de

On Mac you can use brew to install:

brew install aspell
brew install enchant

Usage

To execute the translation tests simply run

py.test --translations

Every file ending in .mo and .po will be discovered and tested, starting from the command line arguments.

You also can execute only the translation-tests by using:

py.test -m translations --translations

Private Word Lists

You will almost certainly use words that are not included in the default dictionaries. That is why you can add your own word list that you want to add to the dictionary.

You may do so by adding a plain text file where each line is a word. Words beginning with a capital letter are case sensitive where lower case words are insensitive.

There can be one file for each language contained in a single folder. The files should be named like the proper language code.

For example:

.
└── .spelling
    ├── de
    ├── en_GB
    └── en_US

What’s left to do is to set an environment variable to point to right directory.

For example:

export PYTEST_TRANSLATIONS_PRIVATE_WORD_LIST=path/to/my/.spelling

pytest-translations's People

Contributors

amureki avatar annefly avatar codingjoe avatar grunskis avatar jayvdb avatar pyup-bot avatar requires avatar syphar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

joequant jayvdb

pytest-translations's Issues

Change from locale/dialect to language breaks tests

Commit 693a31c changed dictionary extraction to strip locale/dialect (e.g. da_DK -> da)
But my understanding of babel and .po files is that it is common to have lines like:

"Language: da_DK\n"

tests no longer run since in po_spelling.py:
if self.language not in supported_languages:

will never match. Any insights?

Initial Update

Hi 👊

This is my first visit to this fine repo, but it seems you have been working hard to keep all dependencies updated so far.

Once you have closed this issue, I'll create seperate pull requests for every update as soon as I find one.

That's it for now!

Happy merging! 🤖

Tests fail on FreeBSD

I'm trying to write FreeBSD and I'm stuck on testing. I would be really glad if you could help me resolve this.

===>  Testing for py37-pytest-translations-2.0.0
===>   py37-pytest-translations-2.0.0 depends on package: py37-testscenarios>=0 - found
===>   py37-pytest-translations-2.0.0 depends on package: py37-fixtures>=0 - found
===>   py37-pytest-translations-2.0.0 depends on package: py37-testresources>=0 - found
===>   py37-pytest-translations-2.0.0 depends on package: py37-mock>=0 - found
===>   py37-pytest-translations-2.0.0 depends on package: py37-virtualenv>=0 - found
===>   py37-pytest-translations-2.0.0 depends on package: py37-wheel>=0 - found
===>   py37-pytest-translations-2.0.0 depends on file: /usr/local/bin/python3.7 - found
cd /usr/ports/devel/py-pytest-translations/work-py37/pytest-translations-2.0.0 && /usr/bin/env PYTHONPATH=/usr/ports/devel/py-pytest-translations/work-py37/pytest-translations-2.0.0/src /usr/local/bin/python3.7 -m pytest -v -rs -o addopts=
============================= test session starts ==============================
platform freebsd12 -- Python 3.7.5, pytest-4.5.0, py-1.8.0, pluggy-0.12.0 -- /usr/local/bin/python3.7
cachedir: .pytest_cache
rootdir: /usr/ports/devel/py-pytest-translations/work-py37/pytest-translations-2.0.0, inifile: setup.cfg
plugins: translations-2.0.0
collecting ... collected 18 items

test_translations.py::TestMo::test_broken_file PASSED                    [  5%]
test_translations.py::TestMo::test_ok PASSED                             [ 11%]
test_translations.py::TestMo::test_missing_po PASSED                     [ 16%]
test_translations.py::TestMo::test_entry_mismatch PASSED                 [ 22%]
test_translations.py::TestPo::test_uses_argument PASSED                  [ 27%]
test_translations.py::TestPo::test_broken_file PASSED                    [ 33%]
test_translations.py::TestPo::test_valid PASSED                          [ 38%]
test_translations.py::TestPo::test_missing_translation PASSED            [ 44%]
test_translations.py::TestPo::test_fuzzy PASSED                          [ 50%]
test_translations.py::TestPo::test_obsolete PASSED                       [ 55%]
test_translations.py::TestPo::test_all PASSED                            [ 61%]
test_translations.py::TestPoSpellcheck::test_broken_file PASSED          [ 66%]
test_translations.py::TestPoSpellcheck::test_language_missing_in_po FAILED [ 72%]
test_translations.py::TestPoSpellcheck::test_language_catalog_missing FAILED [ 77%]
test_translations.py::TestPoSpellcheck::test_python_format_placeholders FAILED [ 83%]
test_translations.py::TestPoSpellcheck::test_pass FAILED                 [ 88%]
test_translations.py::TestPoSpellcheck::test_fail FAILED                 [ 94%]
test_translations.py::TestPoSpellcheck::test_wordlist FAILED             [100%]

=================================== FAILURES ===================================
_________________ TestPoSpellcheck.test_language_missing_in_po _________________

self = <test_translations.TestPoSpellcheck object at 0x803635610>
testdir = <Testdir local('/tmp/pytest-of-root/pytest-4/test_language_missing_in_po0')>

    def test_language_missing_in_po(self, testdir):
        testdir.makefile(
            'po',
            """
            #: asdf.py:111
            msgid "meeting"
            msgstr "meeeting"
            """
        )
        result = testdir.runpytest('--translations', '-vvv', '-r', 's')
        result.stdout.fnmatch_lines([
            "*collected 4*",
>           "SKIP * no language defined in PO file",
        ])
E       Failed: nomatch: '*collected 4*'
E           and: '============================= test session starts =============================='
E           and: 'platform freebsd12 -- Python 3.7.5, pytest-4.5.0, py-1.8.0, pluggy-0.12.0 -- /usr/local/bin/python3.7'
E           and: 'cachedir: .pytest_cache'
E           and: 'rootdir: /tmp/pytest-of-root/pytest-4/test_language_missing_in_po0'
E           and: 'plugins: translations-2.0.0'
E       fnmatch: '*collected 4*'
E          with: 'collecting ... collected 4 items'
E       nomatch: 'SKIP * no language defined in PO file'
E           and: ''
E           and: 'test_language_missing_in_po.po::test_language_missing_in_po.po PASSED    [ 25%]'
E           and: 'test_language_missing_in_po.po::test_language_missing_in_po.po PASSED    [ 25%]'
E           and: 'test_language_missing_in_po.po::test_language_missing_in_po.po PASSED    [ 25%]'
E           and: 'test_language_missing_in_po.po::test_language_missing_in_po.po SKIPPED   [ 25%]'
E           and: ''
E           and: '=============================== warnings summary ==============================='
E           and: '/usr/local/lib/python3.7/site-packages/_pytest/mark/structures.py:324'
E           and: '  /usr/local/lib/python3.7/site-packages/_pytest/mark/structures.py:324: PytestUnknownMarkWarning: Unknown pytest.mark.translations - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html'
E           and: '    PytestUnknownMarkWarning,'
E           and: ''
E           and: '-- Docs: https://docs.pytest.org/en/latest/warnings.html'
E           and: '=========================== short test summary info ============================'
E           and: 'SKIPPED [1] /usr/ports/devel/py-pytest-translations/work-py37/pytest-translations-2.0.0/pytest_translations/po_spelling.py:69: no language defined in PO file'
E           and: '=============== 3 passed, 1 skipped, 1 warnings in 0.01 seconds ================'
E           and: ''
E       remains unmatched: 'SKIP * no language defined in PO file'

/usr/ports/devel/py-pytest-translations/work-py37/pytest-translations-2.0.0/test_translations.py:249: Failed
----------------------------- Captured stdout call -----------------------------
============================= test session starts ==============================
platform freebsd12 -- Python 3.7.5, pytest-4.5.0, py-1.8.0, pluggy-0.12.0 -- /usr/local/bin/python3.7
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-root/pytest-4/test_language_missing_in_po0
plugins: translations-2.0.0
collecting ... collected 4 items

test_language_missing_in_po.po::test_language_missing_in_po.po PASSED    [ 25%]
test_language_missing_in_po.po::test_language_missing_in_po.po PASSED    [ 25%]
test_language_missing_in_po.po::test_language_missing_in_po.po PASSED    [ 25%]
test_language_missing_in_po.po::test_language_missing_in_po.po SKIPPED   [ 25%]

=============================== warnings summary ===============================
/usr/local/lib/python3.7/site-packages/_pytest/mark/structures.py:324
  /usr/local/lib/python3.7/site-packages/_pytest/mark/structures.py:324: PytestUnknownMarkWarning: Unknown pytest.mark.translations - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html
    PytestUnknownMarkWarning,

-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
SKIPPED [1] /usr/ports/devel/py-pytest-translations/work-py37/pytest-translations-2.0.0/pytest_translations/po_spelling.py:69: no language defined in PO file
=============== 3 passed, 1 skipped, 1 warnings in 0.01 seconds ================
________________ TestPoSpellcheck.test_language_catalog_missing ________________

self = <test_translations.TestPoSpellcheck object at 0x803741410>
testdir = <Testdir local('/tmp/pytest-of-root/pytest-4/test_language_catalog_missing0')>

    def test_language_catalog_missing(self, testdir):
        testdir.makefile(
            'po',
            """
            msgid ""
            msgstr ""
            "Language: hr\\n"
    
            #: asdf.py:111
            msgid "meeting"
            msgstr "meeeting"
            """
        )
        result = testdir.runpytest('--translations', '-vvv', '-r', 's')
        result.stdout.fnmatch_lines([
            "*collected 4*",
>           "SKIP * aspell dictionary for language hr not found*",
        ])
E       Failed: nomatch: '*collected 4*'
E           and: '============================= test session starts =============================='
E           and: 'platform freebsd12 -- Python 3.7.5, pytest-4.5.0, py-1.8.0, pluggy-0.12.0 -- /usr/local/bin/python3.7'
E           and: 'cachedir: .pytest_cache'
E           and: 'rootdir: /tmp/pytest-of-root/pytest-4/test_language_catalog_missing0'
E           and: 'plugins: translations-2.0.0'
E       fnmatch: '*collected 4*'
E          with: 'collecting ... collected 4 items'
E       nomatch: 'SKIP * aspell dictionary for language hr not found*'
E           and: ''
E           and: 'test_language_catalog_missing.po::test_language_catalog_missing.po PASSED [ 25%]'
E           and: 'test_language_catalog_missing.po::test_language_catalog_missing.po PASSED [ 25%]'
E           and: 'test_language_catalog_missing.po::test_language_catalog_missing.po PASSED [ 25%]'
E           and: 'test_language_catalog_missing.po::test_language_catalog_missing.po SKIPPED [ 25%]'
E           and: ''
E           and: '=============================== warnings summary ==============================='
E           and: '/usr/local/lib/python3.7/site-packages/_pytest/mark/structures.py:324'
E           and: '  /usr/local/lib/python3.7/site-packages/_pytest/mark/structures.py:324: PytestUnknownMarkWarning: Unknown pytest.mark.translations - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html'
E           and: '    PytestUnknownMarkWarning,'
E           and: ''
E           and: '-- Docs: https://docs.pytest.org/en/latest/warnings.html'
E           and: '=========================== short test summary info ============================'
E           and: 'SKIPPED [1] /usr/ports/devel/py-pytest-translations/work-py37/pytest-translations-2.0.0/pytest_translations/po_spelling.py:73: aspell dictionary for language hr not found.'
E           and: '=============== 3 passed, 1 skipped, 1 warnings in 0.01 seconds ================'
E           and: ''
E       remains unmatched: 'SKIP * aspell dictionary for language hr not found*'

/usr/ports/devel/py-pytest-translations/work-py37/pytest-translations-2.0.0/test_translations.py:268: Failed
----------------------------- Captured stdout call -----------------------------
============================= test session starts ==============================
platform freebsd12 -- Python 3.7.5, pytest-4.5.0, py-1.8.0, pluggy-0.12.0 -- /usr/local/bin/python3.7
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-root/pytest-4/test_language_catalog_missing0
plugins: translations-2.0.0
collecting ... collected 4 items

test_language_catalog_missing.po::test_language_catalog_missing.po PASSED [ 25%]
test_language_catalog_missing.po::test_language_catalog_missing.po PASSED [ 25%]
test_language_catalog_missing.po::test_language_catalog_missing.po PASSED [ 25%]
test_language_catalog_missing.po::test_language_catalog_missing.po SKIPPED [ 25%]

=============================== warnings summary ===============================
/usr/local/lib/python3.7/site-packages/_pytest/mark/structures.py:324
  /usr/local/lib/python3.7/site-packages/_pytest/mark/structures.py:324: PytestUnknownMarkWarning: Unknown pytest.mark.translations - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html
    PytestUnknownMarkWarning,

-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
SKIPPED [1] /usr/ports/devel/py-pytest-translations/work-py37/pytest-translations-2.0.0/pytest_translations/po_spelling.py:73: aspell dictionary for language hr not found.
=============== 3 passed, 1 skipped, 1 warnings in 0.01 seconds ================
_______________ TestPoSpellcheck.test_python_format_placeholders _______________

self = <test_translations.TestPoSpellcheck object at 0x8037c65d0>
testdir = <Testdir local('/tmp/pytest-of-root/pytest-4/test_python_format_placeholders0')>

    def test_python_format_placeholders(self, testdir):
        testdir.makefile(
            'po',
            """
            msgid ""
            msgstr ""
            "Language: de\\n"
    
            #: asdf.py:111
            msgid "meeting"
            msgstr "Langer Text %(salkdjfalsdjf)s {kaksjsalkas} Verabredung"
            """
        )
        result = testdir.runpytest('--translations', '-vvv', '-r', 's')
        result.stdout.fnmatch_lines([
            "*collected 4*",
>           "*4 passed*",
        ])
E       Failed: nomatch: '*collected 4*'
E           and: '============================= test session starts =============================='
E           and: 'platform freebsd12 -- Python 3.7.5, pytest-4.5.0, py-1.8.0, pluggy-0.12.0 -- /usr/local/bin/python3.7'
E           and: 'cachedir: .pytest_cache'
E           and: 'rootdir: /tmp/pytest-of-root/pytest-4/test_python_format_placeholders0'
E           and: 'plugins: translations-2.0.0'
E       fnmatch: '*collected 4*'
E          with: 'collecting ... collected 4 items'
E       nomatch: '*4 passed*'
E           and: ''
E           and: 'test_python_format_placeholders.po::test_python_format_placeholders.po PASSED [ 25%]'
E           and: 'test_python_format_placeholders.po::test_python_format_placeholders.po PASSED [ 25%]'
E           and: 'test_python_format_placeholders.po::test_python_format_placeholders.po PASSED [ 25%]'
E           and: 'test_python_format_placeholders.po::test_python_format_placeholders.po SKIPPED [ 25%]'
E           and: ''
E           and: '=============================== warnings summary ==============================='
E           and: '/usr/local/lib/python3.7/site-packages/_pytest/mark/structures.py:324'
E           and: '  /usr/local/lib/python3.7/site-packages/_pytest/mark/structures.py:324: PytestUnknownMarkWarning: Unknown pytest.mark.translations - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html'
E           and: '    PytestUnknownMarkWarning,'
E           and: ''
E           and: '-- Docs: https://docs.pytest.org/en/latest/warnings.html'
E           and: '=========================== short test summary info ============================'
E           and: 'SKIPPED [1] /usr/ports/devel/py-pytest-translations/work-py37/pytest-translations-2.0.0/pytest_translations/po_spelling.py:73: aspell dictionary for language de not found.'
E           and: '=============== 3 passed, 1 skipped, 1 warnings in 0.01 seconds ================'
E           and: ''
E       remains unmatched: '*4 passed*'

/usr/ports/devel/py-pytest-translations/work-py37/pytest-translations-2.0.0/test_translations.py:287: Failed
----------------------------- Captured stdout call -----------------------------
============================= test session starts ==============================
platform freebsd12 -- Python 3.7.5, pytest-4.5.0, py-1.8.0, pluggy-0.12.0 -- /usr/local/bin/python3.7
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-root/pytest-4/test_python_format_placeholders0
plugins: translations-2.0.0
collecting ... collected 4 items

test_python_format_placeholders.po::test_python_format_placeholders.po PASSED [ 25%]
test_python_format_placeholders.po::test_python_format_placeholders.po PASSED [ 25%]
test_python_format_placeholders.po::test_python_format_placeholders.po PASSED [ 25%]
test_python_format_placeholders.po::test_python_format_placeholders.po SKIPPED [ 25%]

=============================== warnings summary ===============================
/usr/local/lib/python3.7/site-packages/_pytest/mark/structures.py:324
  /usr/local/lib/python3.7/site-packages/_pytest/mark/structures.py:324: PytestUnknownMarkWarning: Unknown pytest.mark.translations - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html
    PytestUnknownMarkWarning,

-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
SKIPPED [1] /usr/ports/devel/py-pytest-translations/work-py37/pytest-translations-2.0.0/pytest_translations/po_spelling.py:73: aspell dictionary for language de not found.
=============== 3 passed, 1 skipped, 1 warnings in 0.01 seconds ================
__________________________ TestPoSpellcheck.test_pass __________________________

self = <test_translations.TestPoSpellcheck object at 0x8038847d0>
testdir = <Testdir local('/tmp/pytest-of-root/pytest-4/test_pass0')>

    def test_pass(self, testdir):
        testdir.makefile(
            'po',
            """
            msgid ""
            msgstr ""
            "Language: de\\n"
    
            #: asdf.py:111
            msgid "meeting"
            msgstr "Verabredung"
            """
        )
        result = testdir.runpytest('--translations', '-vvv', '-r', 's')
        result.stdout.fnmatch_lines([
            "*collected 4*",
>           "*4 passed*",
        ])
E       Failed: nomatch: '*collected 4*'
E           and: '============================= test session starts =============================='
E           and: 'platform freebsd12 -- Python 3.7.5, pytest-4.5.0, py-1.8.0, pluggy-0.12.0 -- /usr/local/bin/python3.7'
E           and: 'cachedir: .pytest_cache'
E           and: 'rootdir: /tmp/pytest-of-root/pytest-4/test_pass0'
E           and: 'plugins: translations-2.0.0'
E       fnmatch: '*collected 4*'
E          with: 'collecting ... collected 4 items'
E       nomatch: '*4 passed*'
E           and: ''
E           and: 'test_pass.po::test_pass.po PASSED                                        [ 25%]'
E           and: 'test_pass.po::test_pass.po PASSED                                        [ 25%]'
E           and: 'test_pass.po::test_pass.po PASSED                                        [ 25%]'
E           and: 'test_pass.po::test_pass.po SKIPPED                                       [ 25%]'
E           and: ''
E           and: '=============================== warnings summary ==============================='
E           and: '/usr/local/lib/python3.7/site-packages/_pytest/mark/structures.py:324'
E           and: '  /usr/local/lib/python3.7/site-packages/_pytest/mark/structures.py:324: PytestUnknownMarkWarning: Unknown pytest.mark.translations - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html'
E           and: '    PytestUnknownMarkWarning,'
E           and: ''
E           and: '-- Docs: https://docs.pytest.org/en/latest/warnings.html'
E           and: '=========================== short test summary info ============================'
E           and: 'SKIPPED [1] /usr/ports/devel/py-pytest-translations/work-py37/pytest-translations-2.0.0/pytest_translations/po_spelling.py:73: aspell dictionary for language de not found.'
E           and: '=============== 3 passed, 1 skipped, 1 warnings in 0.01 seconds ================'
E           and: ''
E       remains unmatched: '*4 passed*'

/usr/ports/devel/py-pytest-translations/work-py37/pytest-translations-2.0.0/test_translations.py:306: Failed
----------------------------- Captured stdout call -----------------------------
============================= test session starts ==============================
platform freebsd12 -- Python 3.7.5, pytest-4.5.0, py-1.8.0, pluggy-0.12.0 -- /usr/local/bin/python3.7
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-root/pytest-4/test_pass0
plugins: translations-2.0.0
collecting ... collected 4 items

test_pass.po::test_pass.po PASSED                                        [ 25%]
test_pass.po::test_pass.po PASSED                                        [ 25%]
test_pass.po::test_pass.po PASSED                                        [ 25%]
test_pass.po::test_pass.po SKIPPED                                       [ 25%]

=============================== warnings summary ===============================
/usr/local/lib/python3.7/site-packages/_pytest/mark/structures.py:324
  /usr/local/lib/python3.7/site-packages/_pytest/mark/structures.py:324: PytestUnknownMarkWarning: Unknown pytest.mark.translations - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html
    PytestUnknownMarkWarning,

-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
SKIPPED [1] /usr/ports/devel/py-pytest-translations/work-py37/pytest-translations-2.0.0/pytest_translations/po_spelling.py:73: aspell dictionary for language de not found.
=============== 3 passed, 1 skipped, 1 warnings in 0.01 seconds ================
__________________________ TestPoSpellcheck.test_fail __________________________

self = <test_translations.TestPoSpellcheck object at 0x8038d5ad0>
testdir = <Testdir local('/tmp/pytest-of-root/pytest-4/test_fail0')>

    def test_fail(self, testdir):
        testdir.makefile(
            'po',
            """
            msgid ""
            msgstr ""
            "Language: de\\n"
    
            #: asdf.py:111
            msgid "meeting"
            msgstr "meeeting"
            """
        )
        result = testdir.runpytest('--translations', '-vvv', '-r', 's')
        result.stdout.fnmatch_lines([
            "*collected 4*",
            '*Spell checking failed:*',
            '*msgstr "meeeting"*',
>           "*1 failed*",
        ])
E       Failed: nomatch: '*collected 4*'
E           and: '============================= test session starts =============================='
E           and: 'platform freebsd12 -- Python 3.7.5, pytest-4.5.0, py-1.8.0, pluggy-0.12.0 -- /usr/local/bin/python3.7'
E           and: 'cachedir: .pytest_cache'
E           and: 'rootdir: /tmp/pytest-of-root/pytest-4/test_fail0'
E           and: 'plugins: translations-2.0.0'
E       fnmatch: '*collected 4*'
E          with: 'collecting ... collected 4 items'
E       nomatch: '*Spell checking failed:*'
E           and: ''
E           and: 'test_fail.po::test_fail.po PASSED                                        [ 25%]'
E           and: 'test_fail.po::test_fail.po PASSED                                        [ 25%]'
E           and: 'test_fail.po::test_fail.po PASSED                                        [ 25%]'
E           and: 'test_fail.po::test_fail.po SKIPPED                                       [ 25%]'
E           and: ''
E           and: '=============================== warnings summary ==============================='
E           and: '/usr/local/lib/python3.7/site-packages/_pytest/mark/structures.py:324'
E           and: '  /usr/local/lib/python3.7/site-packages/_pytest/mark/structures.py:324: PytestUnknownMarkWarning: Unknown pytest.mark.translations - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html'
E           and: '    PytestUnknownMarkWarning,'
E           and: ''
E           and: '-- Docs: https://docs.pytest.org/en/latest/warnings.html'
E           and: '=========================== short test summary info ============================'
E           and: 'SKIPPED [1] /usr/ports/devel/py-pytest-translations/work-py37/pytest-translations-2.0.0/pytest_translations/po_spelling.py:73: aspell dictionary for language de not found.'
E           and: '=============== 3 passed, 1 skipped, 1 warnings in 0.01 seconds ================'
E           and: ''
E       remains unmatched: '*Spell checking failed:*'

/usr/ports/devel/py-pytest-translations/work-py37/pytest-translations-2.0.0/test_translations.py:327: Failed
----------------------------- Captured stdout call -----------------------------
============================= test session starts ==============================
platform freebsd12 -- Python 3.7.5, pytest-4.5.0, py-1.8.0, pluggy-0.12.0 -- /usr/local/bin/python3.7
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-root/pytest-4/test_fail0
plugins: translations-2.0.0
collecting ... collected 4 items

test_fail.po::test_fail.po PASSED                                        [ 25%]
test_fail.po::test_fail.po PASSED                                        [ 25%]
test_fail.po::test_fail.po PASSED                                        [ 25%]
test_fail.po::test_fail.po SKIPPED                                       [ 25%]

=============================== warnings summary ===============================
/usr/local/lib/python3.7/site-packages/_pytest/mark/structures.py:324
  /usr/local/lib/python3.7/site-packages/_pytest/mark/structures.py:324: PytestUnknownMarkWarning: Unknown pytest.mark.translations - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html
    PytestUnknownMarkWarning,

-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ============================
SKIPPED [1] /usr/ports/devel/py-pytest-translations/work-py37/pytest-translations-2.0.0/pytest_translations/po_spelling.py:73: aspell dictionary for language de not found.
=============== 3 passed, 1 skipped, 1 warnings in 0.01 seconds ================
________________________ TestPoSpellcheck.test_wordlist ________________________

self = <test_translations.TestPoSpellcheck object at 0x8039c0290>
testdir = <Testdir local('/tmp/pytest-of-root/pytest-4/test_wordlist0')>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x8039c0890>

    def test_wordlist(self, testdir, monkeypatch):
        testdir.makefile(
            'po',
            """
            msgid ""
            msgstr ""
            "Language: de\\n"
    
            #: asdf.py:111
            msgid "meeting"
            msgstr "meeeting"
            """
        )
    
        test_dir = str(testdir.tmpdir.dirpath())
        wordlist_de = os.path.join(test_dir, 'de')
        assert not os.path.exists(wordlist_de)
    
        with open(wordlist_de, 'w+') as wl:
            wl.write("meeeting\n")
    
        monkeypatch.setenv('PYTEST_TRANSLATIONS_PRIVATE_WORD_LIST', test_dir)
    
        assert os.path.exists(wordlist_de)
    
        result = testdir.runpytest('--translations', '-vvv')
        result.stdout.fnmatch_lines([
            "*collected 4*",
>           "*4 passed*",
        ])
E       Failed: nomatch: '*collected 4*'
E           and: '============================= test session starts =============================='
E           and: 'platform freebsd12 -- Python 3.7.5, pytest-4.5.0, py-1.8.0, pluggy-0.12.0 -- /usr/local/bin/python3.7'
E           and: 'cachedir: .pytest_cache'
E           and: 'rootdir: /tmp/pytest-of-root/pytest-4/test_wordlist0'
E           and: 'plugins: translations-2.0.0'
E       fnmatch: '*collected 4*'
E          with: 'collecting ... collected 4 items'
E       nomatch: '*4 passed*'
E           and: ''
E           and: 'test_wordlist.po::test_wordlist.po PASSED                                [ 25%]'
E           and: 'test_wordlist.po::test_wordlist.po PASSED                                [ 25%]'
E           and: 'test_wordlist.po::test_wordlist.po PASSED                                [ 25%]'
E           and: 'test_wordlist.po::test_wordlist.po SKIPPED                               [ 25%]'
E           and: ''
E           and: '=============================== warnings summary ==============================='
E           and: '/usr/local/lib/python3.7/site-packages/_pytest/mark/structures.py:324'
E           and: '  /usr/local/lib/python3.7/site-packages/_pytest/mark/structures.py:324: PytestUnknownMarkWarning: Unknown pytest.mark.translations - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html'
E           and: '    PytestUnknownMarkWarning,'
E           and: ''
E           and: '-- Docs: https://docs.pytest.org/en/latest/warnings.html'
E           and: '=============== 3 passed, 1 skipped, 1 warnings in 0.01 seconds ================'
E           and: ''
E       remains unmatched: '*4 passed*'

/usr/ports/devel/py-pytest-translations/work-py37/pytest-translations-2.0.0/test_translations.py:358: Failed
----------------------------- Captured stdout call -----------------------------
============================= test session starts ==============================
platform freebsd12 -- Python 3.7.5, pytest-4.5.0, py-1.8.0, pluggy-0.12.0 -- /usr/local/bin/python3.7
cachedir: .pytest_cache
rootdir: /tmp/pytest-of-root/pytest-4/test_wordlist0
plugins: translations-2.0.0
collecting ... collected 4 items

test_wordlist.po::test_wordlist.po PASSED                                [ 25%]
test_wordlist.po::test_wordlist.po PASSED                                [ 25%]
test_wordlist.po::test_wordlist.po PASSED                                [ 25%]
test_wordlist.po::test_wordlist.po SKIPPED                               [ 25%]

=============================== warnings summary ===============================
/usr/local/lib/python3.7/site-packages/_pytest/mark/structures.py:324
  /usr/local/lib/python3.7/site-packages/_pytest/mark/structures.py:324: PytestUnknownMarkWarning: Unknown pytest.mark.translations - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html
    PytestUnknownMarkWarning,

-- Docs: https://docs.pytest.org/en/latest/warnings.html
=============== 3 passed, 1 skipped, 1 warnings in 0.01 seconds ================
===================== 6 failed, 12 passed in 1.69 seconds ======================
*** Error code 1

Stop.
make: stopped in /usr/ports/devel/py-pytest-translations

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.