Encountered an interesting issue at work recently when it came to unit testing a new repo that was setup. The repo in question was relatively small and functioned as a basic cronjob, however in order to follow some best practices I decided to opt in for including some basic unit tests.
In doing so I mistakenly wrote a unit test for a private Python class signified with the standard underscore prefix! As I haven't coded in Python in a while I had forgotten about this syntax, but I was a little stunned to hear from a colleague that best practice seems to be to purposefully not test private methods.
I'm curious to hear the thoughts from the Dev community on this one? I get by their very nature you should probably opt to test the Class that the method belongs to end to end rather than opt for a unit test, but what about when you're looking for simple test functionality in a timely manner?
Curious to hear from the community on this one! (across different languages/frameworks too - not just Python)
There are a lot of people who love both JS and UX/CSS. If we stop labeling people just as “JS developers” or “UX developers”, we can achieve a ceasefire in the current “JS vs. CSS” war and achieve a mutually benefiting peace.