Add `else` clause to catch a case where `ValidationError` does not happen in pydantic example
This does not seem related:
lint: commands[3]> python scripts/astpath_lint.py src/ scripts/ examples/ benchmarks/benchmarks/pybench/ docs/examples/ docs/custom_ext/ tests/
no issues found
lint: FAIL code 1 (42.57=setup[6.18]+cmd[0.07,20.52,14.12,1.68] seconds)
evaluation failed :( (42.76 seconds)
error: Recipe `lint` failed on line 22 with exit code 1
Error: Process completed with exit code 1.
@sobolevn Hello! Thank you for your contribution! The main purpose of these examples is demonstration of code behavior, I think that such additions make readability worse.
If you are interesting to exclude possible errors with exception skipped, there are idea to use pytest.raises() context manager inside examples. I have some doubts about this way since documentation examples start look like tests but pytest primitives should be clear to any reader.
I think that such additions make readability worse.
Current code says: ignore ValidationError if it happens.
My version says: ValidationError must happen here.
Anyways, I don't really have a strong opinion about it, so feel free to close :)
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code