prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Add test if TP uses a proper checker
  This commit https://github.com/translate/pootle/commit/1d6ef1c987f2ee421b678fb9ac36e16175e4f364 fixed very hidden bug, let's add a test for it.
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `pytest_pootle/fixtures/models/translation_project.py`
  Content:
  ```
  1 #!/usr/bin/env python
  2 # -*- coding: utf-8 -*-
  3 #
  4 # Copyright (C) Pootle contributors.
  5 #
  6 # This file is a part of the Pootle project. It is distributed under the GPL3
  7 # or later license. See the LICENSE file for a copy of the license and the
  8 # AUTHORS file for copyright and authorship information.
  9 
  10 import pytest
  11 
  12 
  13 def _require_tp(language, project):
  14     """Helper to get/create a new translation project."""
  15     from pootle_translationproject.models import create_translation_project
  16 
  17     return create_translation_project(language, project)
  18 
  19 
  20 def _require_tp_with_obsolete_dir(language, project):
  21     """Helper to get/create a translation project in obsolete state."""
  22     from pootle_translationproject.models import create_translation_project
  23 
  24     tp = create_translation_project(language, project)
  25     tp.directory.makeobsolete()
  26 
  27     return tp
  28 
  29 
  30 @pytest.fixture
  31 def afrikaans_tutorial(afrikaans, tutorial):
  32     """Require Afrikaans Tutorial."""
  33     return _require_tp(afrikaans, tutorial)
  34 
  35 
  36 @pytest.fixture
  37 def arabic_tutorial_obsolete(arabic, tutorial):
  38     """Require Arabic Tutorial in obsolete state."""
  39     return _require_tp_with_obsolete_dir(arabic, tutorial)
  40 
  41 
  42 @pytest.fixture
  43 def english_tutorial(english, tutorial):
  44     """Require English Tutorial."""
  45     return _require_tp(english, tutorial)
  46 
  47 
  48 @pytest.fixture
  49 def french_tutorial(french, tutorial):
  50     """Require French Tutorial."""
  51     return _require_tp(french, tutorial)
  52 
  53 
  54 @pytest.fixture
  55 def spanish_tutorial(spanish, tutorial):
  56     """Require Spanish Tutorial."""
  57     return _require_tp(spanish, tutorial)
  58 
  59 
  60 @pytest.fixture
  61 def italian_tutorial(italian, tutorial):
  62     """Require Italian Tutorial."""
  63     return _require_tp(italian, tutorial)
  64 
  65 
  66 @pytest.fixture
  67 def russian_tutorial(russian, tutorial):
  68     """Require Russian Tutorial."""
  69     return _require_tp(russian, tutorial)
  70 
  71 
  72 @pytest.fixture
  73 def afrikaans_vfolder_test(afrikaans, vfolder_test):
  74     """Require Afrikaans Virtual Folder Test."""
  75     return _require_tp(afrikaans, vfolder_test)
  76 
  77 
  78 @pytest.fixture
  79 def templates_tutorial(templates, tutorial):
  80     """Require Template Tutorial."""
  81     return _require_tp(templates, tutorial)
  82
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/pytest_pootle/fixtures/models/translation_project.py b/pytest_pootle/fixtures/models/translation_project.py
  --- a/pytest_pootle/fixtures/models/translation_project.py
  +++ b/pytest_pootle/fixtures/models/translation_project.py
  @@ -7,6 +7,8 @@
   # or later license. See the LICENSE file for a copy of the license and the
   # AUTHORS file for copyright and authorship information.
   
  +import shutil
  +
   import pytest
   
   
  @@ -79,3 +81,25 @@
   def templates_tutorial(templates, tutorial):
       """Require Template Tutorial."""
       return _require_tp(templates, tutorial)
  +
  +
  +def get_project_checkers():
  +    from translate.filters import checks
  +
  +    return ['standard'] + list(checks.projectcheckers.keys())
  +
  +
  +@pytest.fixture(params=get_project_checkers())
  +def tp_checker_tests(request, english):
  +    from pytest_pootle.factories import ProjectFactory
  +
  +    checker_name = request.param
  +    project = ProjectFactory(
  +        checkstyle=checker_name,
  +        source_language=english)
  +
  +    def _remove_project_directory():
  +        shutil.rmtree(project.get_real_path())
  +    request.addfinalizer(_remove_project_directory)
  +
  +    return (checker_name, project)
  
verification_info: {"golden_diff": "diff --git a/pytest_pootle/fixtures/models/translation_project.py b/pytest_pootle/fixtures/models/translation_project.py\n--- a/pytest_pootle/fixtures/models/translation_project.py\n+++ b/pytest_pootle/fixtures/models/translation_project.py\n@@ -7,6 +7,8 @@\n # or later license. See the LICENSE file for a copy of the license and the\n # AUTHORS file for copyright and authorship information.\n \n+import shutil\n+\n import pytest\n \n \n@@ -79,3 +81,25 @@\n def templates_tutorial(templates, tutorial):\n     \"\"\"Require Template Tutorial.\"\"\"\n     return _require_tp(templates, tutorial)\n+\n+\n+def get_project_checkers():\n+    from translate.filters import checks\n+\n+    return ['standard'] + list(checks.projectcheckers.keys())\n+\n+\n+@pytest.fixture(params=get_project_checkers())\n+def tp_checker_tests(request, english):\n+    from pytest_pootle.factories import ProjectFactory\n+\n+    checker_name = request.param\n+    project = ProjectFactory(\n+        checkstyle=checker_name,\n+        source_language=english)\n+\n+    def _remove_project_directory():\n+        shutil.rmtree(project.get_real_path())\n+    request.addfinalizer(_remove_project_directory)\n+\n+    return (checker_name, project)\n", "issue": "Add test if TP uses a proper checker\nThis commit https://github.com/translate/pootle/commit/1d6ef1c987f2ee421b678fb9ac36e16175e4f364 fixed very hidden bug, let's add a test for it.\n\n", "before_files": [{"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Copyright (C) Pootle contributors.\n#\n# This file is a part of the Pootle project. It is distributed under the GPL3\n# or later license. See the LICENSE file for a copy of the license and the\n# AUTHORS file for copyright and authorship information.\n\nimport pytest\n\n\ndef _require_tp(language, project):\n    \"\"\"Helper to get/create a new translation project.\"\"\"\n    from pootle_translationproject.models import create_translation_project\n\n    return create_translation_project(language, project)\n\n\ndef _require_tp_with_obsolete_dir(language, project):\n    \"\"\"Helper to get/create a translation project in obsolete state.\"\"\"\n    from pootle_translationproject.models import create_translation_project\n\n    tp = create_translation_project(language, project)\n    tp.directory.makeobsolete()\n\n    return tp\n\n\n@pytest.fixture\ndef afrikaans_tutorial(afrikaans, tutorial):\n    \"\"\"Require Afrikaans Tutorial.\"\"\"\n    return _require_tp(afrikaans, tutorial)\n\n\n@pytest.fixture\ndef arabic_tutorial_obsolete(arabic, tutorial):\n    \"\"\"Require Arabic Tutorial in obsolete state.\"\"\"\n    return _require_tp_with_obsolete_dir(arabic, tutorial)\n\n\n@pytest.fixture\ndef english_tutorial(english, tutorial):\n    \"\"\"Require English Tutorial.\"\"\"\n    return _require_tp(english, tutorial)\n\n\n@pytest.fixture\ndef french_tutorial(french, tutorial):\n    \"\"\"Require French Tutorial.\"\"\"\n    return _require_tp(french, tutorial)\n\n\n@pytest.fixture\ndef spanish_tutorial(spanish, tutorial):\n    \"\"\"Require Spanish Tutorial.\"\"\"\n    return _require_tp(spanish, tutorial)\n\n\n@pytest.fixture\ndef italian_tutorial(italian, tutorial):\n    \"\"\"Require Italian Tutorial.\"\"\"\n    return _require_tp(italian, tutorial)\n\n\n@pytest.fixture\ndef russian_tutorial(russian, tutorial):\n    \"\"\"Require Russian Tutorial.\"\"\"\n    return _require_tp(russian, tutorial)\n\n\n@pytest.fixture\ndef afrikaans_vfolder_test(afrikaans, vfolder_test):\n    \"\"\"Require Afrikaans Virtual Folder Test.\"\"\"\n    return _require_tp(afrikaans, vfolder_test)\n\n\n@pytest.fixture\ndef templates_tutorial(templates, tutorial):\n    \"\"\"Require Template Tutorial.\"\"\"\n    return _require_tp(templates, tutorial)\n", "path": "pytest_pootle/fixtures/models/translation_project.py"}], "after_files": [{"content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Copyright (C) Pootle contributors.\n#\n# This file is a part of the Pootle project. It is distributed under the GPL3\n# or later license. See the LICENSE file for a copy of the license and the\n# AUTHORS file for copyright and authorship information.\n\nimport shutil\n\nimport pytest\n\n\ndef _require_tp(language, project):\n    \"\"\"Helper to get/create a new translation project.\"\"\"\n    from pootle_translationproject.models import create_translation_project\n\n    return create_translation_project(language, project)\n\n\ndef _require_tp_with_obsolete_dir(language, project):\n    \"\"\"Helper to get/create a translation project in obsolete state.\"\"\"\n    from pootle_translationproject.models import create_translation_project\n\n    tp = create_translation_project(language, project)\n    tp.directory.makeobsolete()\n\n    return tp\n\n\n@pytest.fixture\ndef afrikaans_tutorial(afrikaans, tutorial):\n    \"\"\"Require Afrikaans Tutorial.\"\"\"\n    return _require_tp(afrikaans, tutorial)\n\n\n@pytest.fixture\ndef arabic_tutorial_obsolete(arabic, tutorial):\n    \"\"\"Require Arabic Tutorial in obsolete state.\"\"\"\n    return _require_tp_with_obsolete_dir(arabic, tutorial)\n\n\n@pytest.fixture\ndef english_tutorial(english, tutorial):\n    \"\"\"Require English Tutorial.\"\"\"\n    return _require_tp(english, tutorial)\n\n\n@pytest.fixture\ndef french_tutorial(french, tutorial):\n    \"\"\"Require French Tutorial.\"\"\"\n    return _require_tp(french, tutorial)\n\n\n@pytest.fixture\ndef spanish_tutorial(spanish, tutorial):\n    \"\"\"Require Spanish Tutorial.\"\"\"\n    return _require_tp(spanish, tutorial)\n\n\n@pytest.fixture\ndef italian_tutorial(italian, tutorial):\n    \"\"\"Require Italian Tutorial.\"\"\"\n    return _require_tp(italian, tutorial)\n\n\n@pytest.fixture\ndef russian_tutorial(russian, tutorial):\n    \"\"\"Require Russian Tutorial.\"\"\"\n    return _require_tp(russian, tutorial)\n\n\n@pytest.fixture\ndef afrikaans_vfolder_test(afrikaans, vfolder_test):\n    \"\"\"Require Afrikaans Virtual Folder Test.\"\"\"\n    return _require_tp(afrikaans, vfolder_test)\n\n\n@pytest.fixture\ndef templates_tutorial(templates, tutorial):\n    \"\"\"Require Template Tutorial.\"\"\"\n    return _require_tp(templates, tutorial)\n\n\ndef get_project_checkers():\n    from translate.filters import checks\n\n    return ['standard'] + list(checks.projectcheckers.keys())\n\n\n@pytest.fixture(params=get_project_checkers())\ndef tp_checker_tests(request, english):\n    from pytest_pootle.factories import ProjectFactory\n\n    checker_name = request.param\n    project = ProjectFactory(\n        checkstyle=checker_name,\n        source_language=english)\n\n    def _remove_project_directory():\n        shutil.rmtree(project.get_real_path())\n    request.addfinalizer(_remove_project_directory)\n\n    return (checker_name, project)\n", "path": "pytest_pootle/fixtures/models/translation_project.py"}]}