Skip to content

Commit

Permalink
Add meta data to sample cases test file
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorena Mesa committed Jul 17, 2024
1 parent b19a262 commit 0254d88
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions test/sample_cases_test.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
import subprocess
import os
import sys
#!/usr/bin/env python3

from pathlib import Path
import time
import subprocess
import unittest

__author__ = "Lorena Mesa"
__email__ = "[email protected]"

PROJECT_ROOT = Path(__file__).parent.parent.absolute()

from contextlib import contextmanager


@contextmanager
def redirect_stdout(new_out):
# https://stackoverflow.com/questions/47066063/how-to-capture-python-subprocess-stdout-in-unittest
old_stdout = os.dup(1)
try:
os.dup2(new_out, sys.stdout.fileno())
yield
finally:
os.dup2(old_stdout, 1)


class TestHappyPath(unittest.TestCase):
Expand Down

0 comments on commit 0254d88

Please sign in to comment.