Skip to content

Commit

Permalink
Merge pull request #1377 from effigies/test/fixes
Browse files Browse the repository at this point in the history
TEST: Do not depend on test order in test_api_validators
  • Loading branch information
effigies authored Oct 15, 2024
2 parents 3b1c7b3 + 22980e3 commit e9ed337
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 e9ed337

Please sign in to comment.