summaryrefslogtreecommitdiffstats
path: root/tests/test_helper.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 16:27:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 16:27:43 +0000
commit5a5427c3888e2619d53f6943447b7db5bf082366 (patch)
tree3ecafb5ca77f89abdeddb14eb42f90187b811e0d /tests/test_helper.py
parentInitial commit. (diff)
downloadasciinema-upstream.tar.xz
asciinema-upstream.zip
Adding upstream version 2.2.0.upstream/2.2.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--tests/test_helper.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_helper.py b/tests/test_helper.py
new file mode 100644
index 0000000..03b7e97
--- /dev/null
+++ b/tests/test_helper.py
@@ -0,0 +1,16 @@
+import sys
+from codecs import StreamReader
+from io import StringIO
+from typing import Optional, TextIO, Union
+
+stdout: Optional[Union[TextIO, StreamReader]] = None
+
+
+class Test:
+ def setUp(self) -> None:
+ global stdout # pylint: disable=global-statement
+ self.real_stdout = sys.stdout
+ sys.stdout = stdout = StringIO()
+
+ def tearDown(self) -> None:
+ sys.stdout = self.real_stdout