Skip to content

Commit bc4697c

Browse files
authored
Fix dependencies for python 3.9 (#9)
1 parent 5ef5e0c commit bc4697c

File tree

2 files changed

+13
-24
lines changed

2 files changed

+13
-24
lines changed

.github/workflows/python-test.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
python-version: [3.7, 3.8]
14+
python-version:
15+
- "3.7"
16+
- "3.8"
17+
- "3.9"
18+
- "3.10"
1519

1620
steps:
1721
- uses: actions/checkout@v2
@@ -25,8 +29,7 @@ jobs:
2529
pip install flake8 pytest pytest-cov wheel
2630
- name: Install package
2731
run: |
28-
python setup.py develop
29-
pip install -e .[full]
32+
pip install .[full]
3033
- name: Lint with flake8
3134
run: |
3235
# stop the build if there are Python syntax errors or undefined names

tests/test_config_type_def.py

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111

1212

1313
def test_path():
14-
TypeDef.load(pathlib.Path, '/bin') == pathlib.Path('/bin')
15-
TypeDef.load(os.PathLike, '/bin') == pathlib.Path('/bin')
16-
TypeDef.load(pathlib.PosixPath, '/bin') == pathlib.Path('/bin')
17-
TypeDef.dump(pathlib.Path, pathlib.Path('/bin')) == '/bin'
14+
assert TypeDef.load(pathlib.Path, '/bin') == pathlib.Path('/bin')
15+
assert TypeDef.load(os.PathLike, '/bin') == pathlib.Path('/bin')
16+
assert TypeDef.load(pathlib.PosixPath, '/bin') == pathlib.Path('/bin')
17+
assert TypeDef.dump(pathlib.Path, pathlib.Path('/bin')) == '/bin'
1818

1919

2020
def test_any():
21-
TypeDef.load(typing.Any, 123) == 123
22-
TypeDef.dump(typing.Any, '456') == '456'
21+
assert TypeDef.load(typing.Any, 123) == 123
22+
assert TypeDef.dump(typing.Any, '456') == '456'
2323

2424

2525
def test_unsupported_type():
@@ -113,7 +113,7 @@ class MyEnum(str, Enum):
113113

114114
assert TypeDef.load(MyEnum, 'state2_val') == MyEnum.state2
115115
assert TypeDef.dump(MyEnum, MyEnum.state1) == 'state1_val'
116-
with pytest.raises(ValidationError, match='is not a valid MyEnum'):
116+
with pytest.raises(ValidationError, match='is not a valid'):
117117
TypeDef.load(MyEnum, 'other')
118118
with pytest.raises(ValidationError, match='Expect a enum'):
119119
TypeDef.dump(MyEnum, 'state1_val')
@@ -259,17 +259,3 @@ def __init__(self, a: typing.Union[submodule, ClassConfig[submodule]],
259259
{'a': {'a': 1, 'b': 2}, 'b': {'a': 3, 'b': 4, 'c': 5}}).b.c == 5
260260
assert TypeDef.load(ClassConfig[module],
261261
{'a': {'a': 1, 'b': 2}, 'b': {'a': 3, 'b': 4, 'c': 5}}).build().b._c == 5
262-
263-
264-
test_path()
265-
test_optional()
266-
test_any()
267-
test_unsupported_type()
268-
test_primitive()
269-
test_list()
270-
test_tuple()
271-
test_dict()
272-
test_enum()
273-
test_dataclass()
274-
test_union()
275-
test_class_config()

0 commit comments

Comments
 (0)