diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ba9f43..2e2090e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -131,7 +131,7 @@ jobs: fail-fast: false matrix: os: [macos, windows] - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10.0-beta.2'] + python-version: ['3.6', '3.7', '3.8', '3.9', '3.10.0-beta.4'] env: PYTHON: ${{ matrix.python-version }} OS: ${{ matrix.os }} diff --git a/tests/test_main.py b/tests/test_main.py index 3db4112..8d2ec63 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -803,15 +803,10 @@ def test_literal_enum_values(): with pytest.raises(ValidationError) as exc_info: Model(baz=FooEnum.bar) - if sys.version_info < (3, 10): - enum_repr = "" - else: - enum_repr = 'FooEnum.foo' - assert exc_info.value.errors() == [ { 'loc': ('baz',), - 'msg': f'unexpected value; permitted: {enum_repr}', + 'msg': "unexpected value; permitted: ", 'type': 'value_error.const', 'ctx': {'given': FooEnum.bar, 'permitted': (FooEnum.foo,)}, }, diff --git a/tests/test_types.py b/tests/test_types.py index 52a3998..d40f885 100644 --- a/tests/test_types.py +++ b/tests/test_types.py @@ -835,10 +835,7 @@ def test_enum_successful(): m = CookingModel(tool=2) assert m.fruit == FruitEnum.pear assert m.tool == ToolEnum.wrench - if sys.version_info < (3, 10): - assert repr(m.tool) == '' - else: - assert repr(m.tool) == 'ToolEnum.wrench' + assert repr(m.tool) == '' def test_enum_fails(): @@ -858,10 +855,7 @@ def test_enum_fails(): def test_int_enum_successful_for_str_int(): m = CookingModel(tool='2') assert m.tool == ToolEnum.wrench - if sys.version_info < (3, 10): - assert repr(m.tool) == '' - else: - assert repr(m.tool) == 'ToolEnum.wrench' + assert repr(m.tool) == '' def test_enum_type():