but I dont want to run every test in the file (the...
# general
b
but I dont want to run every test in the file (they are slow) i want to target one or two specific ones that I can do via the idea
h
You can pass pytest args, including test selection args, through to pytest like this:
Copy code
$ pants test path/to/my/test.py -- -k name_of_test_func
e
Related: You can export your lockfile as a virtualenvironment following the instructions at https://www.pantsbuild.org/2.21/docs/using-pants/setting-up-an-ide
Then you can set your IDE to use that venv
b
This seemed to solve the problem I've been banging my head on:
Copy code
$ ROOTS=$(pants roots)
$ python3 -c "print('PYTHONPATH=./' + ':./'.join('''${ROOTS}'''.replace(' ', '\\ ').split('\n')) + ':\$PYTHONPATH')" > .env
I did do the codegen but I'm not certain if that really solved anything
e
There's two parts. Setting the PYTHONPATH is so your IDE knows how to import packages (including for code inspection tools) for your source code.
Exporting the venv is so your IDE can access the 3rd party packages you've set for your requirements