I wouldn't call the first version well factored since "x ^ 2" is repeated. So you could simplify to
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.