Files
Samuel Colvin f341049b9e Remove Cython & Move to pyproject.toml (#4473)
* Remove Cython

* fix CI

* fix coverage

* fix tests

* switching to pypyroject.toml

* pre-commit all and use pre-commit for linting

* no mypy tests on macos and windows on ci, use flake8-pyproject

* fix docs and tests CI

* check build is working

* drop pytest-cov

* window and macos ci with 3.11, reduce filtering

* use pip-tools to pin all dependencies

* fix docs and fastapi tests

* fix test deps for 3.7

* no cache on tests job

* revert fastapi changes, fix coverage

* fix mypy coverage

* test with older mypy

* dotenv not required for mypy tests

* split testing requirements std and extra

* typo

* @PrettyWood comments

* correct branch name

* mypy python_version and pr template
2022-09-06 17:15:51 +01:00

26 lines
539 B
Python

import re
from packaging.version import parse as parse_version
import pydantic
from pydantic.version import version_info
def test_version_info():
s = version_info()
assert re.match(' *pydantic version: ', s)
assert s.count('\n') == 4
def test_standard_version():
v = parse_version(pydantic.VERSION)
assert str(v) == pydantic.VERSION
def test_version_attribute_is_present():
assert hasattr(pydantic, '__version__')
def test_version_attribute_is_a_string():
assert isinstance(pydantic.__version__, str)