Commits
Click on a commit to change the comparison range[red-knot] Move `UnionBuilder` tests to Markdown
This moves almost all of our existing `UnionBuilder` tests to a
Markdown-based test suite.
I see how this could be a more controversial change, since these tests
where written specifically for `UnionBuilder`, and by creating the union
types using Python type expressions, we add an additional layer on top
(parsing and inference of these expressions) that move these tests
away from clean unit tests more in the direction of integration tests.
Also, there are probably a few implementation details of `UnionBuilder`
hidden in the test assertions (e.g. order of union elements after
simplifications).
That said, I think we would like to see all those properties that are
being tested here from *any* implementation of union types. And the
Markdown tests come with the usual advantages:
- Much more consice
- Better readability
- No re-compiliation when working on tests
- Easier to add additional explanations and structure to the test suite Apply suggestions from code review
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: T-256 <132141463+T-256@users.noreply.github.com>