mirror of
https://github.com/open-telemetry/opentelemetry-python-contrib.git
synced 2025-08-01 09:13:23 +08:00
Merge in latest from datadog/dd-trace-py (#1)
This commit is contained in:
29
tests/contrib/pylons/app/lib/helpers.py
Normal file
29
tests/contrib/pylons/app/lib/helpers.py
Normal file
@ -0,0 +1,29 @@
|
||||
from webhelpers import * # noqa
|
||||
|
||||
|
||||
class ExceptionWithCodeMethod(Exception):
|
||||
"""Use case where the status code is defined by
|
||||
the `code()` method.
|
||||
"""
|
||||
def __init__(self, message):
|
||||
super(ExceptionWithCodeMethod, self).__init__(message)
|
||||
|
||||
def code():
|
||||
pass
|
||||
|
||||
|
||||
class AppGlobals(object):
|
||||
"""Object used to store application globals."""
|
||||
pass
|
||||
|
||||
|
||||
def get_render_fn():
|
||||
"""Re-import the function everytime so that double-patching
|
||||
is correctly tested.
|
||||
"""
|
||||
try:
|
||||
from pylons.templating import render_mako as render
|
||||
except ImportError:
|
||||
from pylons.templating import render
|
||||
|
||||
return render
|
Reference in New Issue
Block a user