Skip to content
Snippets Groups Projects
conftest.py 648 B
"""
Shared config for all tests
"""
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), 'lib'))



import pytest
import shutil
import pprint
from glob import glob

@pytest.fixture(autouse=True)
def run_before_and_after_tests(tmp_path):
    """Fixture to execute asserts before and after a test is run"""
    # Setup: fill with any logic you want
    os.chdir(tmp_path)
    print(os.getcwd())

    yield # this is where the testing happens

    # print the current directory's list of files
    pp = pprint.PrettyPrinter()
    pp.pprint(glob("*"))

    # Teardown : fill with any logic you want
    shutil.rmtree(tmp_path)