forked from pydantic/pydantic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify and cleanup the
test_mypy.py
file (pydantic#10612)
- Loading branch information
Showing
3 changed files
with
113 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
def test_explicit_reexports() -> None: | ||
from pydantic import __all__ as root_all | ||
from pydantic.deprecated.tools import __all__ as tools | ||
from pydantic.main import __all__ as main | ||
from pydantic.networks import __all__ as networks | ||
from pydantic.types import __all__ as types | ||
|
||
for name, export_all in [('main', main), ('networks', networks), ('deprecated.tools', tools), ('types', types)]: | ||
for export in export_all: | ||
assert export in root_all, f'{export} is in `pydantic.{name}.__all__` but missing in `pydantic.__all__`' | ||
|
||
|
||
def test_explicit_reexports_exist() -> None: | ||
import pydantic | ||
|
||
for name in pydantic.__all__: | ||
assert hasattr(pydantic, name), f'{name} is in `pydantic.__all__` but `from pydantic import {name}` fails' |