Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on warnings raised in tests #140

Merged
merged 2 commits into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ exclude = ["tests*"]

[tool.pytest.ini_options]
addopts = "--cov=bg_atlasapi"
filterwarnings = [
"error",
]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
]

[tool.black]
target-version = ['py38', 'py39', 'py310', 'py311']
Expand Down
5 changes: 3 additions & 2 deletions tests/test_core_atlas.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,15 @@ def test_additional_ref_dict(temp_path):
for k in ["1", "2"]:
stack = np.ones((10, 20, 30)) * int(k)
fake_data[k] = stack
tifffile.imsave(temp_path / f"{k}.tiff", stack)
tifffile.imwrite(temp_path / f"{k}.tiff", stack)

add_ref_dict = AdditionalRefDict(fake_data.keys(), temp_path)

for k, stack in add_ref_dict.items():
assert add_ref_dict[k] == stack

assert add_ref_dict["3"] is None
with pytest.warns(UserWarning, match="No reference named 3"):
assert add_ref_dict["3"] is None


@pytest.mark.parametrize(
Expand Down
1 change: 1 addition & 0 deletions tests/test_structure_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
]


@pytest.mark.filterwarnings("ignore:No mesh filename for region root")
def test_structure_indexing():
structures_dict = StructuresDict(structures_list)
print(structures_dict)
Expand Down