r/Python • • Sep 15 '21

Discussion Testing in Python sucks, let’s make it better

https://baetia.medium.com/testing-in-python-sucks-lets-make-it-better-e52203f1b9c1
1 Upvotes

3 comments sorted by

12

u/billsil Sep 15 '21

You didn't show a failed case.

Also, why invent a new syntax when people know assert? It's less clear. Most people using unittest use it (even though they're not supposed to) and pytest downright encourages it. Why reinvent the wheel to make everyone's code incompatible?

At the very least, support both.

1

u/spacespacespapce Sep 17 '21

Ya the documentation was thrown together at the end but the two main parts of the library are the syntax sugar of "expectations" and the actual runner itself.

If you don't wanna use a new runner, you can import just the expectations (which wrap around normal asserts) and use them around your tests for a nicer dev experience that way.

You're right supporting both would be a great way to get a lift for this lib but honestly it was a fun project to make the terminal output nicer and kinda left it after that haha

4

u/PossibilityTasty Sep 16 '21

Testing in Python is fine.