don't require warning when at wrong git version

This commit is contained in:
sneakers-the-rat 2023-10-09 19:04:00 -07:00
parent a7b0f8880e
commit 2b530c4b33
2 changed files with 6 additions and 5 deletions

View file

@ -5,5 +5,7 @@ from ..fixtures import linkml_schema_bare, linkml_schema, nwb_schema
from nwb_linkml.adapters import DatasetAdapter, ClassAdapter from nwb_linkml.adapters import DatasetAdapter, ClassAdapter
def test_build_base(nwb_schema): def test_build_base(nwb_schema):
# simplest case, nothing special here
dset = DatasetAdapter(cls=nwb_schema.datasets['image'])
pass pass

View file

@ -72,14 +72,13 @@ def test_gitrepo_check(source, commit):
repo.clone() repo.clone()
assert repo.check() assert repo.check()
# check should fail when repo is at wrong commit # check should not warn but get us to the correct commit
assert repo.active_commit == commit assert repo.active_commit == commit
repo._git_call('checkout', 'HEAD~10') repo._git_call('checkout', 'HEAD~10')
with pytest.warns(UserWarning, match=".*wrong commit.*"): assert repo.active_commit != commit
assert not repo.check() # check should pass but switch to proper commit
repo.commit = commit
assert repo.active_commit == commit
assert repo.check() assert repo.check()
assert repo.active_commit == commit
# check should fail on repo namespace mismatch # check should fail on repo namespace mismatch
old_repo = repo.namespace.repository old_repo = repo.namespace.repository