changeset 6367:b936b1c3d575

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.
author Mads Kiilerich <mads@kiilerich.com>
date Mon, 19 Dec 2016 02:52:01 +0100
parents c77888faf2aa
children 2f4effc51867
files kallithea/tests/functional/test_pullrequests.py
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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')