Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Test on py3.9-dev #129

Merged
merged 4 commits into from
Jun 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ python:
- "3.5"
- "3.6"
- "3.7"
- "3.8-dev"
- "3.8"
- "3.9-dev"

install:
- pip install mypy
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
2.2
* Add Python3.9 to the supported versions

2.1
* Written new usage example
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
],
keywords='typing types mypy json',
packages=['typedload'],
Expand Down
17 changes: 16 additions & 1 deletion tests/test_typechecks.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
class TestChecks(unittest.TestCase):

def test_is_literal(self):
if sys.version_info.minor >= 8 :
if sys.version_info.minor >= 8:
l = Literal[1, 2, 3]
assert typechecks.is_literal(l)

Expand Down Expand Up @@ -58,28 +58,43 @@ def test_is_list(self):
assert not typechecks.is_list(Tuple[int, str])
assert not typechecks.is_list(Dict[int, str])
assert not typechecks.is_list([])
if sys.version_info.minor >= 9:
assert typechecks.is_list(list[str])
assert not typechecks.is_list(tuple[str])

def test_is_dict(self):
assert typechecks.is_dict(Dict[int, int])
assert typechecks.is_dict(Dict)
assert typechecks.is_dict(Dict[str, str])
assert not typechecks.is_dict(Tuple[str, str])
assert not typechecks.is_dict(Set[str])
if sys.version_info.minor >= 9:
assert typechecks.is_dict(dict[str, str])
assert not typechecks.is_dict(tuple[str])

def test_is_set(self):
assert typechecks.is_set(Set[int])
assert typechecks.is_set(Set)
if sys.version_info.minor >= 9:
assert typechecks.is_set(set[str])
assert not typechecks.is_set(tuple[str])

def test_is_frozenset_(self):
assert not typechecks.is_frozenset(Set[int])
assert typechecks.is_frozenset(FrozenSet[int])
assert typechecks.is_frozenset(FrozenSet)
if sys.version_info.minor >= 9:
assert typechecks.is_frozenset(frozenset[str])
assert not typechecks.is_frozenset(tuple[str])

def test_is_tuple(self):
assert typechecks.is_tuple(Tuple[str, int, int])
assert typechecks.is_tuple(Tuple)
assert not typechecks.is_tuple(tuple)
assert not typechecks.is_tuple((1,2))
if sys.version_info.minor >= 9:
assert typechecks.is_tuple(tuple[str])
assert not typechecks.is_tuple(list[str])

def test_is_union(self):
assert typechecks.is_union(Optional[int])
Expand Down