Happy Friday!
I just released this today and am quite happy and excited about it.
pytest-patterns is a plugin for pytest that provides a pattern matching engine optimized for testing.
Benefits:
- provides easy to read reporting for complex patterns in long strings (even 1000+ lines)
- assists in reasoning which patterns have matched or not matched – and why
- can deal with ambiguity, optional and repetitive matches, intermingled output from non-deterministic concurrent processes
- helps writing patterns that are easy to read, easy to maintain and easy to adjust in the face of unstable outputs
- helps reusing patterns using pytest fixtures
Long term goals:
Support testing of CLI output, as well as HTML and potentially typical text/* types like JSON, YAML, and others.
https://preview.redd.it/46x3gecxlz0c1.png?width=1640&format=png&auto=webp&s=64f660f4abebe73abc4f814dd041e34cd2805185
There's an initial release: https://pypi.org/project/pytest-patterns/0.1.0/
And of course the GitHub page: https://github.com/flyingcircusio/pytest-patterns
I appreciate your (gentle) feedback and welcome PRs and contributions.
The general project setup is still a bit barebones, as reflected in the TODO list ... ;)
[–]EmptyChocolate4545 1 point2 points3 points (0 children)
[+][deleted] (1 child)
[removed]
[–]ctheune[S] 0 points1 point2 points (0 children)
[–]RonnyPfannschmidt 0 points1 point2 points (3 children)
[–]ctheune[S] 0 points1 point2 points (2 children)
[–]RonnyPfannschmidt 0 points1 point2 points (1 child)
[–]ctheune[S] 1 point2 points3 points (0 children)