pytest-django icon indicating copy to clipboard operation
pytest-django copied to clipboard

Running with xdist results in unexpected 403 status codes from DRF APIClient

Open timworx opened this issue 3 years ago • 2 comments

Hey all, I have a large passing test suite that doesn't seem to get along with pytest-xdist.

The status code responses from the Django Rest Framework test APIClient suddenly all become 403 errors.

The client uses a fixture for the user that is being supplied for authentication. There is no higher scoping given to anything (e.g. no session, module, etc scoping).

Are there any known problems that I'm missing here?

Versions:

django==3.2.9
pytest==6.2.5
pytest-django==4.4.0
pytest-xdist==2.4.0

From pytest runs:

platform darwin -- Python 3.8.1, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
plugins: asyncio-0.16.0, django-4.3.0, xdist-2.4.0, forked-1.3.0

timworx avatar Nov 18 '21 14:11 timworx

I also have this issue

tim-win avatar Apr 29 '22 13:04 tim-win

I am not a maintainer, but it is very difficult to say what is wrong just reading your comments. It would be great to have the small reproducible example on which we can see the issue and reproduce it and then debug and fix.

sshishov avatar May 11 '22 07:05 sshishov