Skip to content

Commit

Permalink
check tuple
Browse files Browse the repository at this point in the history
  • Loading branch information
vpoulailleau committed Feb 2, 2021
1 parent 97bde75 commit a9082a7
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/po_with_warnings/tuple.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#: ../Doc/library/typing.rst:19
msgid ""
"tuple"
msgstr ""
"n-uplet"
5 changes: 5 additions & 0 deletions tests/po_without_warnings/tuple.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#: ../Doc/library/typing.rst:19
msgid ""
"tuple"
msgstr ""
"*n*-uplet"
13 changes: 13 additions & 0 deletions tests/test_po_without_warnings.py → tests/test_po_warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,23 @@ def pytest_generate_tests(metafunc):
metafunc.parametrize(
"known_good_po_file", [str(file_path) for file_path in files]
)
if "known_bad_po_file" in metafunc.fixturenames:
# assume using tox (that cd into tests directory)
files = list(Path("./po_with_warnings").rglob("*.po"))
files.extend(Path("./tests/po_with_warnings").rglob("*.po"))
metafunc.parametrize(
"known_bad_po_file", [str(file_path) for file_path in files]
)


def test_no_error_no_warning(known_good_po_file):
"""Test known to be good files."""
errors, warnings = check_file(known_good_po_file)
assert not errors
assert not warnings


def test_error_or_warning(known_bad_po_file):
"""Test known to be bad files."""
errors, warnings = check_file(known_bad_po_file)
assert errors or warnings

0 comments on commit a9082a7

Please sign in to comment.