Skip to content

Commit

Permalink
use pytest.fail
Browse files Browse the repository at this point in the history
  • Loading branch information
erohmensing committed Dec 6, 2023
1 parent 2a836f0 commit b513577
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,32 @@ def list_all_paths_in_fixture_directory(folder_name: str) -> List[str]:
@pytest.fixture(scope="session")
def valid_metadata_yaml_files() -> List[str]:
files = list_all_paths_in_fixture_directory("metadata_validate/valid")
assert len(files) > 0, "No files found in metadata_validate/valid"
if not files:
pytest.fail("No files found in metadata_validate/valid")
return files


@pytest.fixture(scope="session")
def invalid_metadata_yaml_files() -> List[str]:
files = list_all_paths_in_fixture_directory("metadata_validate/invalid")
assert len(files) > 0, "No files found in metadata_validate/invalid"
if not files:
pytest.fail("No files found in metadata_validate/invalid")
return files


@pytest.fixture(scope="session")
def valid_metadata_upload_files() -> List[str]:
files = list_all_paths_in_fixture_directory("metadata_upload/valid")
assert len(files) > 0, "No files found in metadata_upload/valid"
if not files:
pytest.fail("No files found in metadata_upload/valid")
return files


@pytest.fixture(scope="session")
def invalid_metadata_upload_files() -> List[str]:
files = list_all_paths_in_fixture_directory("metadata_upload/invalid")
assert len(files) > 0, "No files found in metadata_upload/invalid"
if not files:
pytest.fail("No files found in metadata_upload/invalid")
return files


Expand Down

0 comments on commit b513577

Please sign in to comment.