Effective PyCharm Transcripts
Chapter: Unit testing
Lecture: Debugging tests
Login or purchase this course to watch this video and the rest of the course contents.
0:00 I made a slight change to our failing tests so that it will actually pass, go back and change this less than two greater than if you'd like to see it
0:08 fail. I just want to make sure we can have all of our tests for this project passing. But I also made it use a random number here.
0:15 Why is that? Because I want to actually show you the ability to debug it Like what if we need to know what is going on in this test.
0:22 Normally you might just run pytest from the CLI or something like that. I would like to know exactly what is happening here so we can do a couple
0:32 of things. First notice that we can just run individual tests by right there by
0:36 clicking it. I could say run this will actually create a nude run configuration up there. I could equally run this one and look the test,
0:46 change the fails passing. But if I put a breakpoint here, I can click the debug there, I can go over in this and click the debug there.
0:54 Or I can just click the debug here. Once I have it running either the individual or all of them And we go and look at that right now. Number is 179.
1:06 So if you want to focus in and actually debug these things, we already saw how awesome the PyCharm debugger is.
1:13 Well there's a super easy way to figure out why your test might be failing. Set a break point.