Check if the Code Still Runs the Same
00:00
Because we have this conditional statement here that says if source ==
target
, and now this is much easier to read from from our input here, we see "source"
does equal "target"
at the moment. In line 13, you can see that "source"
is 0
, and "target"
is 0
as well.
00:14
So this conditional is going to evaluate to True
, and the error is going to get raised. And let’s confirm that too.
00:25
If I run this example, then you can see that the AssertionError
gets thrown just as it did before.
00:31 And that’s also helpful when you’re refactoring your code, to every once in a while also run the example to see that you’re not changing anything and see that it still works as before. There’s better ways to do this, but we’ll talk about this in a bit.
Become a Member to join the conversation.