Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upSupport assert statements inside validators #653
Conversation
This comment has been minimized.
This comment has been minimized.
codecov
bot
commented
Jul 11, 2019
•
Codecov Report
@@ Coverage Diff @@
## master #653 +/- ##
==========================================
- Coverage 100% 99.92% -0.08%
==========================================
Files 15 15
Lines 2720 2725 +5
Branches 534 536 +2
==========================================
+ Hits 2720 2723 +3
- Misses 0 2 +2 |
This comment has been minimized.
This comment has been minimized.
Please create an issue to discuss this first. Such big changes can't just be implemented directly as a PR. |
This comment has been minimized.
This comment has been minimized.
Ah sorry, good idea :) |
I like this! I would suggest adding a section in the docs explaining how to use it and adding a small caveat about @dmontagu 's comment: #654 (comment) |
0e1fc9f
to
62aff72
This comment has been minimized.
This comment has been minimized.
@tiangolo Updated docs with a warning |
44787d6
to
d5d9655
This comment has been minimized.
This comment has been minimized.
Away from my computer, so ignore this if it's covered in the code. If pytest is giving you trouble, add a simple python test like the mypy external tests and add it to make. |
LGTM, but please add a section to |
This comment has been minimized.
This comment has been minimized.
any chance we could get this fixed? I would like to get everything currently pending on the next release so I can work exclusively on v1. |
This comment has been minimized.
This comment has been minimized.
This is missed release v0.32, let's now include it in v1. That wasn't my original plan, but probably makes sense since it's quite a big conceptual change (even if it's backwards compatible). |
This comment has been minimized.
This comment has been minimized.
please can you rebase and move the history change to |
This comment has been minimized.
This comment has been minimized.
I think I've addressed the outstanding issues in https://github.com/dmontagu/pydantic/tree/assert_statement_support I opened a PR against @abdusco 's branch (though it involved a rebase against master which I guess might cause issues). @samuelcolvin let me know if you want me to just make a separate PR. |
This comment has been minimized.
This comment has been minimized.
4873aa8
to
642cf87
fail_test(test_name, ['ValidationError was not raised']) | ||
|
||
|
||
def fail_test(test_name: str, description: List[str]): |
This comment has been minimized.
This comment has been minimized.
dmontagu
Aug 11, 2019
Collaborator
I added a little bit of pretty error reporting to make it easier for contributors to realize what is going wrong if this test is failing. @samuelcolvin Let me know if you take any issue with the style here.
otherwise LGTM. |
This comment has been minimized.
This comment has been minimized.
Just realized I never pushed the fixes to the |
f41d5dc
into
samuelcolvin:master
abdusco commentedJul 11, 2019
•
edited by dmontagu
Change Summary
This PR adds support for
assert
statements inside validators (related: #654). This means we can use:to raise validation errors.
I've updated docs, but haven't been able to build it on Windows. I'm getting this error:
Checklist
HISTORY.rst
has been updated#<number>
@<whomever>