Skip to content

Commit

Permalink
add conftest.py that mocks out tg context
Browse files Browse the repository at this point in the history
  • Loading branch information
dill0wn committed Jan 17, 2024
1 parent 5e30e6f commit 83b71b9
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import pytest

# should get rid of this once this issue is fixed https://github.com/TurboGears/tg2/issues/136
@pytest.fixture(autouse=True, scope='session')
def tg_context_patch():
from tg import (
request as r,
tmpl_context as c,
app_globals as g,
cache,
response,
translator,
url,
config,
)
r.__dict__['_is_coroutine'] = False
c.__dict__['_is_coroutine'] = False
g.__dict__['_is_coroutine'] = False
cache.__dict__['_is_coroutine'] = False
response.__dict__['_is_coroutine'] = False
translator.__dict__['_is_coroutine'] = False
url.__dict__['_is_coroutine'] = False
config.__dict__['_is_coroutine'] = False

0 comments on commit 83b71b9

Please sign in to comment.