Prechádzať zdrojové kódy

Move patch_inline_callbacks into synapse/

Erik Johnston 4 rokov pred
rodič
commit
1d6dd1c294

+ 1 - 1
synapse/__init__.py

@@ -20,7 +20,7 @@
 import os
 import os
 import sys
 import sys
 
 
-from tests.patch_inline_callbacks import do_patch
+from synapse.util.patch_inline_callbacks import do_patch
 
 
 # Check that we're not running on an unsupported Python version.
 # Check that we're not running on an unsupported Python version.
 if sys.version_info < (3, 5):
 if sys.version_info < (3, 5):

+ 1 - 1
tests/patch_inline_callbacks.py → synapse/util/patch_inline_callbacks.py

@@ -105,7 +105,7 @@ def do_patch():
 
 
 
 
 def _check_yield_points(f, changes, start_context):
 def _check_yield_points(f, changes, start_context):
-    """Wraps a generator that is about to passed to defer.inlineCallbacks
+    """Wraps a generator that is about to be passed to defer.inlineCallbacks
     checking that after every yield the log contexts are correct.
     checking that after every yield the log contexts are correct.
     """
     """
 
 

+ 2 - 2
tests/__init__.py

@@ -16,9 +16,9 @@
 
 
 from twisted.trial import util
 from twisted.trial import util
 
 
-import tests.patch_inline_callbacks
+from synapse.util.patch_inline_callbacks import do_patch
 
 
 # attempt to do the patch before we load any synapse code
 # attempt to do the patch before we load any synapse code
-tests.patch_inline_callbacks.do_patch()
+do_patch()
 
 
 util.DEFAULT_TIMEOUT_DURATION = 20
 util.DEFAULT_TIMEOUT_DURATION = 20