Skip to content

Commit

Permalink
TEST: Do not depend on test order in test_api_validators (nipy#1377)
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Oct 15, 2024
1 parent 249986b commit 1712cb0
Showing 1 changed file with 4 additions and 4 deletions.
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'}

0 comments on commit 1712cb0

Please sign in to comment.