Skip to content

tst: use pytest fixture #3059

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

Merged
merged 1 commit into from
Oct 2, 2019
Merged

tst: use pytest fixture #3059

merged 1 commit into from
Oct 2, 2019

Conversation

mgxd
Copy link
Member

@mgxd mgxd commented Oct 1, 2019

Trying again after #3058 - otherwise we should xfail it for the time being.

Acknowledgment

  • (Mandatory) I acknowledge that this contribution will be available under the Apache 2 license.

@effigies
Copy link
Member

effigies commented Oct 1, 2019

Should we retry, to improve the odds of completion? If it's really hit-or-miss, this is likely to be a constant source of noise in coverage reports.

Copy link
Member

@effigies effigies left a comment

Choose a reason for hiding this comment

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

Not actually sure if this would work, but here's a thought...

return data
@pytest.fixture
def fetch_data():
def _fetch_data(datadir, dicoms):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def _fetch_data(datadir, dicoms):
def _fetch_data(datadir, dicoms, retry=3):

data = os.path.join(datadir, dicoms)
api.get(path=data)
except IncompleteResultsError as exc:
pytest.skip("Failed to fetch test data: %s" % str(exc))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
pytest.skip("Failed to fetch test data: %s" % str(exc))
if retry:
return _fetch_data(datadir, dicoms, retry=retry-1)
pytest.skip("Failed to fetch test data: %s" % str(exc))

@effigies
Copy link
Member

effigies commented Oct 2, 2019

Merging. If the codecov thing becomes an issue, we can add in the retry, but the stochastic failures are a bigger problem right now.

@effigies effigies merged commit 6e80cea into nipy:master Oct 2, 2019
@effigies effigies added this to the 1.3.0 milestone Oct 3, 2019
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.

2 participants