Skip to content

TST: Refactor API test#188

Merged
36000 merged 1 commit into
tractometry:mainfrom
arokem:nightly-75561654890
May 12, 2026
Merged

TST: Refactor API test#188
36000 merged 1 commit into
tractometry:mainfrom
arokem:nightly-75561654890

Conversation

@arokem

@arokem arokem commented May 12, 2026

Copy link
Copy Markdown
Member

This test raises the error on initialization, so no object is created.

Fixes this nightly failure: https://github.com/tractometry/pyAFQ/actions/runs/25732697842/job/75561654890

This test raises the error on initialization, so no object is created.
Copilot AI review requested due to automatic review settings May 12, 2026 12:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors test_API_type_checking to handle cases where the expected failure occurs during GroupAFQ initialization (instead of during a later export), preventing the nightly failure where no object is created.

Changes:

  • Moves GroupAFQ(...) construction into the try/except LazyError unwrapping block for the “random seeds with low n_seeds” validation case.
  • Removes the unconditional del myafq cleanup for that case (since myafq may never be assigned if initialization fails early).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread AFQ/tests/test_api.py
Comment on lines 516 to +532
try:
myafq.export("bundles")
myafq = GroupAFQ(
bids_path,
dwi_preproc_pipeline="vistasoft",
t1_preproc_pipeline="freesurfer",
mapping_definition=IdentityMap(),
reg_subject_spec="dti_fa_subject",
tracking_params={
"n_seeds": 10,
"rng_seed": seed,
"random_seeds": True,
"seed_mask": ScalarImage("dti_fa"),
"directions": "det",
"odf_model": "DTI",
},
bundle_info=abd.default_bd()["Left Arcuate", "Right Arcuate"],
)
@36000
36000 merged commit 052706e into tractometry:main May 12, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants