How do I use Scalene to profile my Pytest test suit?

631 Views Asked by At

I want to use Scalene to profile my Pytest test suit

Typically I run the test suit by running

pytest

So I tried

scalene pytest

which doesn't work as I expect.

What is the correct way to run my test suit through scalene?

1

There are 1 best solutions below

0
On

Since Scalene replaces your python interpreter, you have to run pytest as a module from Scalene, like so:

scalene -m pytest

which yields the desired result