pytest sqla: why query results are the same when calling the api several time with different parameters?

Viewed 10

I know my problem will be difficult to explain but I hope there's an easy explanation to that.

I've made an api calling a path with a filter. I did write a test but when I launch my pytest calling this api several times the 1st result is always given as an answer. Let's make it clearer with some code.

If I call the api once on pytest:

http://myapipath

I will get 5 results

http://myapipath?cars=true

I will get 3 results

http://myapipath?cars=false

I will get 2 results

Now if call it twice in the same test with different parameters:

http://myapipath?cars=true #  3 results

http://myapipath?cars=false #  3 results (wrong, ie the ones I had with filter at true)

Is there anything that could explain such a behavior?

0 Answers
Related