Home > Net >  Pytest AssertionError even if status code is correct
Pytest AssertionError even if status code is correct

Time:05-21

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!

CodePudding user response:

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