summaryrefslogtreecommitdiff
path: root/tests/logging_utils_test.py
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2022-02-03 14:18:37 -0800
committerScott Gasch <[email protected]>2022-02-03 14:18:37 -0800
commit713a609bd19d491de03debf8a4a6ddf2540b13dc (patch)
tree6593978162d3c11c3a54e44a770aded4abc79704 /tests/logging_utils_test.py
parenteb1c6392095947b3205c4d52cd9b1507e6cd776b (diff)
Change settings in flake8 and black.
Diffstat (limited to 'tests/logging_utils_test.py')
-rwxr-xr-xtests/logging_utils_test.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/logging_utils_test.py b/tests/logging_utils_test.py
index 87c00d6..a9625d6 100755
--- a/tests/logging_utils_test.py
+++ b/tests/logging_utils_test.py
@@ -11,7 +11,6 @@ import unittest_utils as uu
class TestLoggingUtils(unittest.TestCase):
-
def test_output_context(self):
unique_suffix = sutils.generate_uuid(True)
filename = f'/tmp/logging_utils_test.{unique_suffix}'
@@ -20,11 +19,11 @@ class TestLoggingUtils(unittest.TestCase):
with tempfile.SpooledTemporaryFile(mode='r+') as tmpfile1:
with uu.RecordStdout() as record:
with lutils.OutputMultiplexerContext(
- lutils.OutputMultiplexer.Destination.FILENAMES |
- lutils.OutputMultiplexer.Destination.FILEHANDLES |
- lutils.OutputMultiplexer.Destination.LOG_INFO,
- filenames = [filename, '/dev/null'],
- handles = [tmpfile1, sys.stdout],
+ lutils.OutputMultiplexer.Destination.FILENAMES
+ | lutils.OutputMultiplexer.Destination.FILEHANDLES
+ | lutils.OutputMultiplexer.Destination.LOG_INFO,
+ filenames=[filename, '/dev/null'],
+ handles=[tmpfile1, sys.stdout],
) as mplex:
mplex.print(secret_message, end='')
@@ -46,8 +45,7 @@ class TestLoggingUtils(unittest.TestCase):
with uu.RecordMultipleStreams(sys.stderr, sys.stdout) as record:
print("This is a test!")
print("This is one too.", file=sys.stderr)
- self.assertEqual(record().readlines(),
- ["This is a test!\n", "This is one too.\n"])
+ self.assertEqual(record().readlines(), ["This is a test!\n", "This is one too.\n"])
if __name__ == '__main__':