I am trying to run a trace on a program that is executed with pytest. I am trying the command
python3 -m trace -t pytest test_one.py
but it is giving me
Cannot run file 'pytest' because: [Errno 2] No such file or directory: 'pytest'
as I am assuming trace.py is expecting a file. I saw this similar question but I'm a bit struggling to understand what is supposed to mean - is it supposed to be the executable file for pytest itself (I actually don't see where that is on my computer, I found a folder to a main.py and init.py but I can't seem to see some executable), or something else?
pytest
executable itself. Under *nix, you should be able to localize it usingwhich pytest
, under Windows it's located underScripts
(in the virtual enviroment, or the Python installation path, depending on what you use). – Houriganwhich pytest
on Unix iswhere pytest
on Windows. @MrBeanBremen why not adding an answer yourself? The question is more than a year old, it's unlikely that the OP will give an answer any time soon. – Arceliaarceneaux