You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by di...@apache.org on 2024/01/17 17:29:59 UTC
(allura) branch master updated: add conftest.py that mocks out tg context
This is an automated email from the ASF dual-hosted git repository.
dill0wn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git
The following commit(s) were added to refs/heads/master by this push:
new 83b71b998 add conftest.py that mocks out tg context
83b71b998 is described below
commit 83b71b99895345bb004ff2148b53c23b5f16f409
Author: Dillon Walls <di...@slashdotmedia.com>
AuthorDate: Wed Jan 17 12:26:13 2024 -0500
add conftest.py that mocks out tg context
---
conftest.py | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/conftest.py b/conftest.py
new file mode 100644
index 000000000..5c76dd455
--- /dev/null
+++ b/conftest.py
@@ -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
+
\ No newline at end of file