diff --git a/src/grok/ftests/test_grok_functional.py b/src/grok/ftests/test_grok_functional.py index 648f8526..a95d37d0 100644 --- a/src/grok/ftests/test_grok_functional.py +++ b/src/grok/ftests/test_grok_functional.py @@ -38,16 +38,6 @@ def http_call(method, path, data=None, **kw): return zope.app.wsgi.testlayer.http(request_string, handle_errors=False) -def bprint(data): - """Python 2 and 3 doctest compatible print. - - http://python3porting.com/problems.html#string-representation - """ - if not isinstance(data, str): - data = data.decode() - print(data.strip()) - - def suiteFromPackage(name): files = resource_listdir(__name__, name) suite = unittest.TestSuite() @@ -64,7 +54,7 @@ def suiteFromPackage(name): getRootFolder=layer.getRootFolder, http=zope.app.wsgi.testlayer.http, http_call=http_call, - bprint=bprint, + bprint=grok.testing.bprint, wsgi_app=layer.make_wsgi_app, ), optionflags=( diff --git a/src/grok/testing.py b/src/grok/testing.py index ea929257..aac468dd 100644 --- a/src/grok/testing.py +++ b/src/grok/testing.py @@ -78,3 +78,13 @@ def warn(message, category=None, stacklevel=1): message, line.strip(), )) + + +def bprint(data): + """Python 2 and 3 doctest compatible print. + + http://python3porting.com/problems.html#string-representation + """ + if not isinstance(data, str): + data = data.decode() + print(data.strip())