projects
/
python_utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Disallow where're too.
[python_utils.git]
/
unittest_utils.py
diff --git
a/unittest_utils.py
b/unittest_utils.py
index 81b339ae3485d05e6f76248aa8fbeb70f52ef2a3..b259c6b4c98f687d8e3c8db4b41c280db7ac9d19 100644
(file)
--- a/
unittest_utils.py
+++ b/
unittest_utils.py
@@
-7,7
+7,6
@@
caveat emptor.
"""
caveat emptor.
"""
-from abc import ABC, abstractmethod
import contextlib
import functools
import inspect
import contextlib
import functools
import inspect
@@
-16,20
+15,20
@@
import os
import pickle
import random
import statistics
import pickle
import random
import statistics
-import time
import tempfile
import tempfile
-from typing import Any, Callable, Dict, List, Optional
+import time
import unittest
import warnings
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 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'
logger = logging.getLogger(__name__)
cfg = config.add_commandline_args(
f'Logging ({__file__})', 'Args related to function decorators'
@@
-287,12
+286,12
@@
class RecordStdout(object):
def __enter__(self) -> Callable[[], tempfile.SpooledTemporaryFile]:
self.recorder = contextlib.redirect_stdout(self.destination)
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]:
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
self.recorder.__exit__(*args)
self.destination.seek(0)
return None
@@
-316,12
+315,12
@@
class RecordStderr(object):
def __enter__(self) -> Callable[[], tempfile.SpooledTemporaryFile]:
self.recorder = contextlib.redirect_stderr(self.destination) # type: ignore
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]:
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
self.recorder.__exit__(*args)
self.destination.seek(0)
return None