Skip to content

Commit

Permalink
Add Python 3.10 to Python version (#765)
Browse files Browse the repository at this point in the history
This also add simple test to ensure that
All the supported versions of Python are
listed.

Co-authored-by: Samuel Gaist <samuel,gaist@idiap.ch>
  • Loading branch information
sgaist and Samuel Gaist authored May 16, 2022
1 parent 560c45b commit 6e38bf7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions datamodel_code_generator/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class PythonVersion(Enum):
PY_37 = '3.7'
PY_38 = '3.8'
PY_39 = '3.9'
PY_310 = '3.10'

@property
def has_literal_type(self) -> bool:
Expand Down
9 changes: 9 additions & 0 deletions tests/test_format.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import sys

from datamodel_code_generator.format import PythonVersion


def test_python_version():
"""Ensure that the python version used for the tests is properly listed"""

_ = PythonVersion("{}.{}".format(*sys.version_info[:2]))

0 comments on commit 6e38bf7

Please sign in to comment.