# HG changeset patch # User Mads Kiilerich # Date 1482112321 -3600 # Node ID b936b1c3d5758f487ec8d4f855e3a9c3db445fd7 # Parent c77888faf2aa96f592e514d91aac514db27d2044 tests: give test_pullrequests a test_context in addition to the usual app_fixture test_pullrequests has unit-ish tests that invoke library functions directly ... but these happen to require localization initialized. For TG2 we only have localization initialized when we have a test_context. Thus, additionally wrap these tests in a test_context. diff -r c77888faf2aa -r b936b1c3d575 kallithea/tests/functional/test_pullrequests.py --- a/kallithea/tests/functional/test_pullrequests.py Mon Dec 19 02:52:01 2016 +0100 +++ b/kallithea/tests/functional/test_pullrequests.py Mon Dec 19 02:52:01 2016 +0100 @@ -1,4 +1,7 @@ import re +import pytest + +from kallithea.tests.test_context import test_context from kallithea.tests.base import * from kallithea.tests.fixture import Fixture @@ -207,6 +210,12 @@ class TestPullrequestsGetRepoRefs(TestController): + # this tests need test_context in addition to app_fixture + @pytest.fixture(autouse=True) + def app_test_context_fixture(self, app_fixture): + with test_context(self.app): + yield + def setup_method(self, method): self.repo_name = u'main' repo = fixture.create_repo(self.repo_name, repo_type='hg')