From 767f5d14916aec3e74d02f93f877510aec235664 Mon Sep 17 00:00:00 2001 From: Adam Tyson Date: Fri, 7 Jun 2024 12:40:56 +0100 Subject: [PATCH] Mark tests that are expected to fail with `xfail` rather than just not running them (#367) * update gitignore * xfail tests rather than commenting out --- .gitignore | 2 +- tests/test_streamlines.py | 69 ++++++++++++++++++++------------------- 2 files changed, 37 insertions(+), 34 deletions(-) diff --git a/.gitignore b/.gitignore index f93c9e88..e1f3184e 100644 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,7 @@ brainrender/atlas_specific/gene_expression/__pycache__/* brainrender/atlas_specific/__pycache__ example_brainrender_shot* - +brain_regions.html workspace.py workspace.ipynb brexport.html diff --git a/tests/test_streamlines.py b/tests/test_streamlines.py index aab1a614..47efadbb 100644 --- a/tests/test_streamlines.py +++ b/tests/test_streamlines.py @@ -1,33 +1,36 @@ -# import pandas as pd -# import pytest -# -# from brainrender import Scene -# from brainrender.actors.streamlines import ( -# Streamlines, -# make_streamlines, -# ) -# from brainrender.atlas_specific import get_streamlines_for_region -# -# -# def test_download(): -# streams = get_streamlines_for_region("TH", force_download=False) -# assert len(streams) == 54 -# assert isinstance(streams[0], pd.DataFrame) -# -# -# def test_download_slow(): -# streams = get_streamlines_for_region("TH", force_download=True) -# assert len(streams) == 54 -# assert isinstance(streams[0], pd.DataFrame) -# -# -# def test_streamlines(): -# s = Scene(title="BR") -# streams = get_streamlines_for_region("TH", force_download=False) -# s.add(Streamlines(streams[0])) -# s.add(*make_streamlines(*streams[1:3])) -# -# with pytest.raises(TypeError): -# Streamlines([1, 2, 3]) -# -# del s +import pandas as pd +import pytest + +from brainrender import Scene +from brainrender.actors.streamlines import ( + Streamlines, + make_streamlines, +) +from brainrender.atlas_specific import get_streamlines_for_region + + +@pytest.mark.xfail(reason="Likely due to fail due to neuromorpho") +def test_download(): + streams = get_streamlines_for_region("TH", force_download=False) + assert len(streams) == 54 + assert isinstance(streams[0], pd.DataFrame) + + +@pytest.mark.xfail(reason="Likely due to fail due to neuromorpho") +def test_download_slow(): + streams = get_streamlines_for_region("TH", force_download=True) + assert len(streams) == 54 + assert isinstance(streams[0], pd.DataFrame) + + +@pytest.mark.xfail(reason="Likely due to fail due to neuromorpho") +def test_streamlines(): + s = Scene(title="BR") + streams = get_streamlines_for_region("TH", force_download=False) + s.add(Streamlines(streams[0])) + s.add(*make_streamlines(*streams[1:3])) + + with pytest.raises(TypeError): + Streamlines([1, 2, 3]) + + del s