John
John

Reputation: 276

Pytest AssertionError even if status code is correct

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!

Upvotes: 1

Views: 511

Answers (1)

Teejay Bruno
Teejay Bruno

Reputation: 2159

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

Upvotes: 2

Related Questions