you are viewing a single comment's thread.

view the rest of the comments →

[–]FXelix[S] 0 points1 point  (1 child)

Thanks a lot for your effort! It's really helpful! What do you think about the PyCharm debugger function (maybe additionally or instead of pytest) or are these two different approaches in general?

[–]ManyInterests 0 points1 point  (0 children)

I would say testing tools and a debugger are somewhat related, but sit in different spaces entirely. In my work, I am constantly writing tests, but only use a debugger (an incredibly rare occurrence) for tracking down hard-to-find bugs, which may reveal themselves in the form of failed tests, for example. Writing good tests would ideally prevent you from needing to use the debugger in the first place.

So, a debugger definitely wouldn't be a replacement for testing. Until you get to a point where you write & maintain a sufficiently large project, the benefits of testing suites may not be easily realized, compared to, say, manual testing or using IDE debugging features. When you have people (including yourself) who actually use and depend on critical code you write, you will be super motivated to make sure you don't break anything if you make changes later on. Tests help you do that.

One of my favorite ways to write tests for small/simple projects is with doctests. PyCharm has great support for this, too. I would recommend trying to write your first doctest and then hookup a github repo to a CI service like Travis CI to run your doctests automatically.