Hacker News new | past | comments | ask | show | jobs | submit login
Property-Based Testing in Python (yingw787.com)
3 points by yingw787 on Feb 3, 2021 | hide | past | favorite | 2 comments

I honestly don't find tests that "self documenting". They are complementary and optional to reference documentation, but much less readable. Every time I've looked at them, I've found myself better grasping what the function does by simply reading the function itself.

And having to read regexes in order to understand code seems more like a negative. In that regard pytest and simple unittest code reads more easily IMO.

The most readable test code I've come across is that written in jasmine (behavioural driven testing)

Thanks for sharing! You might have more experience than I do in this sector, I've mostly written tests for tools/projects I've owned for a number of years and that might be why it appears more self-documenting to me. I try to write tests that are relatively clean. By contrast I've also had to maintain Confluence wikis as documentation and I've found it much more difficult, same with versioned Markdown documents and the like. Auto-generated documentation might be a sweet spot, though I don't have experience on that front yet.

I think regexes may have a steep learning curve, but IMHO it's well-worth the effort in order to learn. Pythex is pretty great at learning regexes and once you learn them you have a pretty powerful tool at your disposal for a number of matters.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact