8000 pytest fixtures: hg / git configurations to session scope by tony · Pull Request #475 · vcs-python/libvcs · GitHub
[go: up one dir, main page]

Skip to content

pytest fixtures: hg / git configurations to session scope #475

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Oct 12, 2024
Prev Previous commit
Next Next commit
docs(pytest plugin) Note set_hgconfig and set_gitconfig
  • Loading branch information
tony committed Oct 12, 2024
commit 6330020d707a2e1fc233a2231b4a1ef0b8471336
14 changes: 11 additions & 3 deletions docs/pytest-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,22 @@ These fixtures are automatically used when the plugin is enabled and `pytest` is
- `/home/${user}` ({func}`user_path`)
- Setting your home directory
- Patch `$HOME` to point to {func}`user_path` ({func}`set_home`)
- Set default configuration
- Create configuration files:

- `.gitconfig`, via {func}`gitconfig`:
- `.hgrc`, via {func}`hgconfig`:
- `.gitconfig`, via {func}`gitconfig`
- `.hgrc`, via {func}`hgconfig`

- Set default configuration for VCS:

- Set {func}`hgconfig` to [`HGRCPATH`] via {func}`set_hgconfig`
- Set {func}`gitconfig` to [`GIT_CONFIG`] via {func}`set_gitconfig`

These are set to ensure you can correctly clone and create repositories without without extra
warnings.

[`HGRCPATH`]: https://www.mercurial-scm.org/doc/hg.1.html#:~:text=UNIX%2Dlike%20environments.-,HGRCPATH,-If%20not%20set
[`GIT_CONFIG`]: https://git-scm.com/docs/git-config#Documentation/git-config.txt-GITCONFIG

## Bootstrapping pytest in your `conftest.py`

The most common scenario is you will want to configure the above fixtures with `autouse`.
Expand Down
0