caveat emptor.
"""
-from abc import ABC, abstractmethod
import contextlib
import functools
import inspect
import pickle
import random
import statistics
-import time
import tempfile
-from typing import Any, Callable, Dict, List, Optional
+import time
import unittest
import warnings
+from abc import ABC, abstractmethod
+from typing import Any, Callable, Dict, List, Optional
+
+import sqlalchemy as sa
import bootstrap
import config
import function_utils
import scott_secrets
-import sqlalchemy as sa
-
-
logger = logging.getLogger(__name__)
cfg = config.add_commandline_args(
f'Logging ({__file__})', 'Args related to function decorators'
def __enter__(self) -> Callable[[], tempfile.SpooledTemporaryFile]:
self.recorder = contextlib.redirect_stdout(self.destination)
- assert self.recorder
+ assert self.recorder is not None
self.recorder.__enter__()
return lambda: self.destination
def __exit__(self, *args) -> Optional[bool]:
- assert self.recorder
+ assert self.recorder is not None
self.recorder.__exit__(*args)
self.destination.seek(0)
return None
def __enter__(self) -> Callable[[], tempfile.SpooledTemporaryFile]:
self.recorder = contextlib.redirect_stderr(self.destination) # type: ignore
- assert self.recorder
+ assert self.recorder is not None
self.recorder.__enter__()
return lambda: self.destination
def __exit__(self, *args) -> Optional[bool]:
- assert self.recorder
+ assert self.recorder is not None
self.recorder.__exit__(*args)
self.destination.seek(0)
return None