Provide a gitconfig sandbox for testing
Project description
pytest-gitconfig
Provide a gitconfig sandbox for testing
Getting started
Install pytest-gitconfig:
# pip
pip install pytest-gitconfig
# pipenv
pipenv install pytest-gitconfig
# PDM
pdm add pytest-gitconfig
Provided fixtures
All fixtures are session-scoped.
gitconfig -> GitConfig
This is the main fixture which is creating a new and clean git config file for the test session.
By default, it will set 3 settings:
user.nameuser.emailinit.defaultBranch
The fixture when required provide a GitConfig object with the following methods:
gitconfig.set()accepting either adictwith the parsed data sections or key-values with dotted key names.gitconfig.get()to get a setting given its dotted key.
git_user_name -> str
Provide the initial user.name setting. By default gitconfig.DEFAULT_GIT_USER_NAME.
Override to provide a different initial value.
git_user_email -> str
Provide the initial user.email setting. By default gitconfig.DEFAULT_GIT_USER_EMAIL.
Override to provide a different initial value.
git_init_default_branch -> str
Provide the initial init.defaultBranch setting. By default gitconfig.DEFAULT_GIT_BRANCH (main).
Override to provide a different initial value.
sessionpatch -> pytest.MonkeyPatch
A pytest.MonkeyPatch session instance.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytest_gitconfig-0.2.0.tar.gz.
File metadata
- Download URL: pytest_gitconfig-0.2.0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.7.4 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
716609acb1f1af846b8c227d0697239a6cf760d8b9b6de06ae9f3470a519257c
|
|
| MD5 |
c5714e0791eb7a014e04812a40510bc8
|
|
| BLAKE2b-256 |
02847487295d2b88d0b78644291d9b989ccda89e46905b0505a95d22ecfe857b
|
File details
Details for the file pytest_gitconfig-0.2.0-py3-none-any.whl.
File metadata
- Download URL: pytest_gitconfig-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.7.4 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9796dec4c1f8b10ede1b5eee76419b37ec13e0af7cab5f1197b3b0f8326d586a
|
|
| MD5 |
c3df59322361849ca85c120c144b9b72
|
|
| BLAKE2b-256 |
f0cb83f87458e3168a69e98d0e5c437e6e9caa8c25bd8f5604d754600e084dd3
|