eegdash.testing module#

Lazy fetch of the eegdash binary test corpus.

The raw signal fixtures (BDF, EDF, SET, VHDR, SNIRF, FIF, MEF3 …) live in the separate eegdash/eegdash-testing-data repository, modeled after mne-testing-data. The first time a test asks for one we download the pinned tarball, verify its SHA-256, and unpack into a per-user cache.

Pin (bump both lines when re-tagging the upstream repo):

  • VERSION — git tag on eegdash-testing-data

  • SHA256 — sha256 of the codeload tarball for that tag

Environment overrides#

EEGDASH_TESTING_DATA_DIR

Cache directory (default: ~/.cache/eegdash/testing-data).

EEGDASH_SKIP_TESTING_DATA=true

Skip every @requires_testing_data test; used by air-gapped CI.

Examples

>>> from eegdash.testing import data_path
>>> bdf = data_path() / "eeg" / "sub-001_ses-01_task-meditation_eeg.bdf"
eegdash.testing.data_file(relpath: str) Path[source]

Convenience: data_path() / relpath as a single call.

eegdash.testing.data_path() Path[source]

Return the root of the test corpus, fetching on first use.

Returns:

The unpacked eegdash-testing-data-{VERSION}/ directory.

Return type:

Path

Raises:

RuntimeError – If the download is required but EEGDASH_SKIP_TESTING_DATA=true is set, or if pooch fails to retrieve the tarball.

eegdash.testing.has_testing_data() bool[source]

Return True if the corpus is already unpacked in the cache.

eegdash.testing.requires_testing_data(func)[source]

Pytest decorator: skip if the corpus is unavailable.

Skips when EEGDASH_SKIP_TESTING_DATA=true or the corpus cannot be fetched (e.g. offline CI without a cache hit). The decorator triggers the fetch at collection time so tests that depend on the corpus all share a single download.