Merge tests from version with context.

This commit is contained in:
erinhmclark
2025-02-05 16:42:58 +00:00
parent 91ca325fd5
commit 52542812dc
13 changed files with 1022 additions and 33 deletions

View File

@@ -1,7 +1,8 @@
"""
pytest conftest file, for shared fixtures and configuration
"""
import os
import pickle
from tempfile import TemporaryDirectory
from typing import Dict, Tuple
import hashlib
@@ -113,4 +114,18 @@ def pytest_runtest_setup(item):
test_name = _test_failed_incremental[cls_name].get((), None)
# if name found, test has failed for the combination of class name & test name
if test_name is not None:
pytest.xfail(f"previous test failed ({test_name})")
pytest.xfail(f"previous test failed ({test_name})")
@pytest.fixture()
def unpickle():
"""
Returns a helper function that unpickles a file
** gets the file from the test_files directory: tests/data/test_files **
"""
def _unpickle(path):
test_data_dir = os.path.join(os.path.dirname(__file__), "data", "test_files")
with open(os.path.join(test_data_dir, path), "rb") as f:
return pickle.load(f)
return _unpickle