diff options
author | 2018-04-16 21:08:18 +0200 | |
---|---|---|
committer | 2018-04-16 21:08:18 +0200 | |
commit | 4743f2cd619f6bcfbe6be1dc107b8eb3b9007211 (patch) | |
tree | c82dfceb3d59d0e84cda3402d6e675be90b5f8fb | |
parent | We don't really need this env var anymore. We always want TRACE logging. (diff) |
I guess we were testing for log level handling. Removed these tests. We always want TRACE level logging, we can filter in datadog.
-rw-r--r-- | app_test.py | 11 | ||||
-rw-r--r-- | pysite/__init__.py | 8 |
2 files changed, 1 insertions, 18 deletions
diff --git a/app_test.py b/app_test.py index d94aeb5a..1e46a73d 100644 --- a/app_test.py +++ b/app_test.py @@ -245,17 +245,6 @@ class StaffEndpoints(SiteTest): class Utilities(SiteTest): """ Test cases for internal utility code """ - def test_logging_runtime_error(self): - """ Check that a wrong value for log level raises runtime error """ - os.environ['LOG_LEVEL'] = 'wrong value' - try: - import pysite.__init__ # noqa: F401 - except RuntimeError: - return True - finally: - os.environ['LOG_LEVEL'] = 'info' - raise Exception('Expected a failure due to wrong LOG_LEVEL attribute name') - def test_error_view_runtime_error(self): """ Check that wrong values for error view setup raises runtime error """ import pysite.base_route diff --git a/pysite/__init__.py b/pysite/__init__.py index 2f3ed636..93362f6a 100644 --- a/pysite/__init__.py +++ b/pysite/__init__.py @@ -30,13 +30,7 @@ def monkeypatch_trace(self, msg, *args, **kwargs): Logger.trace = monkeypatch_trace -log_level = "TRACE" - -if hasattr(logging, log_level): - log_level = getattr(logging, log_level) -else: - raise RuntimeError(f"LOG_LEVEL environment variable has invalid value: {log_level}") - +log_level = logging.TRACE logging_handlers = [] if PAPERTRAIL_ADDRESS: |