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

TEST: Do not depend on test order in test_api_validators #1377

Merged
merged 1 commit into from
Oct 15, 2024
Merged
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
8 changes: 4 additions & 4 deletions nibabel/tests/test_api_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,18 @@ class TestRunAllTests(ValidateAPI):
We check this in the module teardown function
"""

run_tests = []
run_tests = {}

def obj_params(self):
yield 1, 2

def validate_first(self, obj, param):
self.run_tests.append('first')
self.run_tests.add('first')

def validate_second(self, obj, param):
self.run_tests.append('second')
self.run_tests.add('second')

@classmethod
def teardown_class(cls):
# Check that both validate_xxx tests got run
assert cls.run_tests == ['first', 'second']
assert cls.run_tests == {'first', 'second'}