by tabhygfr2 · 7y ago · 0 comments
assert square(inp) == square(inp)
...at which point, if it's not 3:00 AM, you hopefully notice that it's not actually testing anything and include both test input data and output data.This is of course a bit of a contrived, very simple example, so it might seem silly, but I think you can imagine more complex functions where it's less clear that "computing" the expected output in some way "cheats" the test.