Reputation: 824
Chris and Pat collaborate on a Python project. The source code is under version control. They each choose their own checkout location on their respective drives. The collaborative application resides in <root>/app.py
.
They both use PyCharm, and since the .idea
folders on their checkout drives have some amount of effort invested, they are reluctant not to check it into the repository.
Yet because the checkout locations are distinct, they cannot share one .idea
folder. They have resolved the problem by storing their .idea
folders in <root>/pycharm/chris/.idea
and <root>/pycharm/pat/.idea
. Both folders are checked into the repository. They can go home with the confidence that if their desktops' disks fail, the effort they spent on their PyCharm configuration is safe.
But something is missing. They write (pytest
-based) tests for their own respective subsets of the code, and they would like to share those tests.
Is there a workflow, from within PyCharm or without, that enables them to work on a unified set of test configurations? I may be missing something basic. It may be the case, for example, that they ought to make an effort to checkout into exactly the same paths, as well as to use venvs located at exactly the same paths, and share the same .idea
all the way. If you've found that that's the only sensible solution, arguing for it would also be an answer.
Upvotes: 2
Views: 109
Reputation: 24038
They should just have one .idea
file in the git repo and .gitignore
the parts they want to keep unique to their systems.
They can also mark a given Run Configuration as "sharable" by enabling "Share" option in it (top right corner of the configuration window). This way it will be stored in .idea/runConfigurations
.
Upvotes: 1
Reputation: 2203
You can check in pytest related configuration in git. Pytest configurations can be stored in pytest.ini
file which can be version controlled.
pytest.ini
file should be at the root of pytest tests directory. Pytest would pick all the test run configuration at the time of test run from that file.
Example config for increasing pytest log verbosity:
#pytest.ini
[pytest]
addopts= -vv
Documentation here: https://docs.pytest.org/en/latest/reference.html#ini-options-ref
Upvotes: 0