Changeset - b936b1c3d575
[Not reviewed]
default
0 1 0
Mads Kiilerich - 9 years ago 2016-12-19 02:52:01
mads@kiilerich.com
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.
1 file changed with 9 insertions and 0 deletions:
0 comments (0 inline, 0 general)
kallithea/tests/functional/test_pullrequests.py
Show inline comments
 
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 TestPullrequestsController(TestCon
 

	
 
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')
0 comments (0 inline, 0 general)