Skip to content

Commit 0254d88

Browse files
author
Lorena Mesa
committed
Add meta data to sample cases test file
1 parent b19a262 commit 0254d88

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

test/sample_cases_test.py

+5-17
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,13 @@
1-
import subprocess
2-
import os
3-
import sys
1+
#!/usr/bin/env python3
2+
43
from pathlib import Path
5-
import time
4+
import subprocess
65
import unittest
76

7+
__author__ = "Lorena Mesa"
8+
__email__ = "[email protected]"
89

910
PROJECT_ROOT = Path(__file__).parent.parent.absolute()
10-
11-
from contextlib import contextmanager
12-
13-
14-
@contextmanager
15-
def redirect_stdout(new_out):
16-
# https://stackoverflow.com/questions/47066063/how-to-capture-python-subprocess-stdout-in-unittest
17-
old_stdout = os.dup(1)
18-
try:
19-
os.dup2(new_out, sys.stdout.fileno())
20-
yield
21-
finally:
22-
os.dup2(old_stdout, 1)
2311

2412

2513
class TestHappyPath(unittest.TestCase):

0 commit comments

Comments
 (0)