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

[MAINT] mark failing test as xfail #101

Merged
merged 4 commits into from
Sep 5, 2024
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
4 changes: 4 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
---
name: test

# Force to use color
env:
FORCE_COLOR: true

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,6 @@ module = [
]

[tool.pytest.ini_options]
addopts = "-ra -q -vv --cov eye2bids --durations=0"
addopts = "-ra --strict-config --strict-markers -q -vv --cov eye2bids --durations=0"
norecursedirs = "data"
testpaths = ["tests/"]
31 changes: 26 additions & 5 deletions tests/test_edf2bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,15 @@ def _check_output_content(output_dir, input_file, eye=1):

# space between timestamps should always be the same.
if ending == "_physio":
# length is because first rwo will give a nan
# length is because first row will give a nan
assert len(df[0].diff().unique()) == 2


@pytest.mark.parametrize(
"folder",
[
"emg",
"lt",
"pitracker",
"rest",
"vergence",
],
)
@pytest.mark.skipif(not _check_edf2asc_present(), reason="edf2asc missing")
Expand All @@ -106,6 +103,29 @@ def test_edf_end_to_end_all(eyelink_test_data_dir, folder):
_check_output_content(output_dir, input_file)


@pytest.mark.xfail(reason="Output is not a continuous recording. See #69.")
@pytest.mark.parametrize(
"folder",
["emg", "lt", "vergence"],
)
@pytest.mark.skipif(not _check_edf2asc_present(), reason="edf2asc missing")
def test_edf_end_to_end_emg_xfail(eyelink_test_data_dir, folder):
"""Run conversion of all test datasets and check output."""
metadata_file = data_dir() / "metadata.yml"

input_dir = eyelink_test_data_dir / folder
input_file = edf_test_files(input_dir=input_dir)[0]

output_dir = data_dir() / "output"
output_dir.mkdir(exist_ok=True)

edf2bids(input_file=input_file, metadata_file=metadata_file, output_dir=output_dir)

_check_output_exists(output_dir, input_file)
_check_output_content(output_dir, input_file)


@pytest.mark.xfail(reason="Output is not a continuous recording. See #69.")
@pytest.mark.skipif(not _check_edf2asc_present(), reason="edf2asc missing")
def test_edf_end_to_end(eyelink_test_data_dir):
metadata_file = data_dir() / "metadata.yml"
Expand All @@ -119,7 +139,6 @@ def test_edf_end_to_end(eyelink_test_data_dir):
edf2bids(input_file=input_file, metadata_file=metadata_file, output_dir=output_dir)

_check_output_exists(output_dir, input_file)
_check_output_content(output_dir, input_file)

expected_events_sidecar = output_dir / f"{input_file.stem}_events.json"
with open(expected_events_sidecar) as f:
Expand All @@ -132,6 +151,8 @@ def test_edf_end_to_end(eyelink_test_data_dir):
assert eyetrack["SamplingFrequency"] == 500
assert eyetrack["RecordedEye"] == "Right"

_check_output_content(output_dir, input_file)


@pytest.mark.skipif(not _check_edf2asc_present(), reason="edf2asc missing")
def test_edf_end_to_end_error_no_metadata(eyelink_test_data_dir):
Expand Down