Pytest AssertionError even if status code is correct

Viewed 43

Why do I keep getting AssertionError when actually 400 is returned as in line 14 is set?

14   assert status_code == 400
15   AssertionError: assert (400, 'Please fulfill all parts!') == 400

Thanks!

1 Answers

you're trying to assert that an int is equal to a tuple.

specifying the index of status_code will solve it.

ie: assert status_code[0] == 400

Related