Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gt, lt, #188

Merged
merged 2 commits into from Jun 2, 2018
Merged

gt, lt, #188

merged 2 commits into from Jun 2, 2018

Conversation

samuelcolvin
Copy link
Member

fix #176

@codecov
Copy link

codecov bot commented Jun 2, 2018

Codecov Report

Merging #188 into master will not change coverage.
The diff coverage is 100%.

@@          Coverage Diff          @@
##           master   #188   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           9      9           
  Lines        1036   1036           
  Branches      214    214           
=====================================
  Hits         1036   1036

@@ -836,3 +836,27 @@ class Model(BaseModel):
assert exc_info.value.flatten_errors() == result
else:
assert Model(foo=value).foo == result


def test_gt():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe better to name test_number_gt and test_number_lt?

with pytest.raises(ValidationError) as exc_info:
Model(a=-1)
assert (
'ensure this value is greater than -1 (type=value_error.number.gt; limit_value=-1)'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why you want to use string representation of errors not .flatten_errors() like in all other tests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just doing the quickest thing, doing it various different ways in tests is a good thing.

@Gr1N
Copy link
Contributor

Gr1N commented Jun 2, 2018

👍

@samuelcolvin samuelcolvin merged commit 95aba15 into master Jun 2, 2018
@samuelcolvin samuelcolvin deleted the fix-gt-lt branch June 2, 2018 19:53
samuelcolvin added a commit that referenced this pull request Jun 6, 2018
samuelcolvin added a commit that referenced this pull request Jun 7, 2018
alexdrydew pushed a commit to alexdrydew/pydantic that referenced this pull request Dec 23, 2023
* improve tuple schema definition

* add "mode" to tuple schema

* made "mode" optinonal on variable tuples

* tweak enum names
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bad error message for gt validation
2 participants