decrease deprecation warnings

This commit is contained in:
sneakers-the-rat 2023-10-04 22:54:20 -07:00
parent 24e0b704ff
commit d77dec5cc0

View file

@ -2,6 +2,7 @@ import pdb
import shutil
import os
import sys
import warnings
from pathlib import Path
from typing import Optional, Union, List
@ -83,7 +84,16 @@ def test_pydantic_provider_core(tmp_output_dir, class_name, test_fields):
core = provider.get('core', allow_repo=False)
# ensure we didn't get the builtin one
assert Path(nwb_linkml.__file__).parent not in Path(core.__file__).parents
assert (tmp_output_dir / 'pydantic' / 'core' / version_module_case(core.version) / 'namespace.py').exists()
namespace_path = (tmp_output_dir / 'pydantic' / 'core' / version_module_case(core.version) / 'namespace.py')
assert namespace_path.exists()
assert Path(core.__file__) == namespace_path
with open(namespace_path, 'r') as nsfile:
nsfile_contents = nsfile.read()
# dk how to debug good on github actions lol
warnings.warn(nsfile_contents)
test_class = getattr(core, class_name)
assert test_class == provider.get_class('core', class_name)