Skip to content

Commit

Permalink
Add extra test for raising error
Browse files Browse the repository at this point in the history
  • Loading branch information
tarsil committed Oct 16, 2023
1 parent 2c2fcf7 commit 6e8709d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/fields/test_fields.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from typing import Any, Dict, List, Mapping, Union

import pytest

from polyforce import Field, PolyField, PolyModel


Expand Down Expand Up @@ -30,3 +32,11 @@ def test_no_annotation():
field: PolyField = Field(default=2, name="name")

assert field.annotation is None


def test_raise_type_error_on_default_field():
with pytest.raises(TypeError):

class NotherModel(PolyModel):
def __init__(self, name: str = Field(default=2)) -> None:
...

0 comments on commit 6e8709d

Please sign in to comment.