-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Presented hg_repo and git_repo as fixtures.
Closes #36
- Loading branch information
Showing
4 changed files
with
42 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import pytest | ||
|
||
from .. import vcs | ||
|
||
|
||
def _ensure_present(repo): | ||
try: | ||
repo.version() | ||
except Exception: | ||
pytest.skip() | ||
|
||
|
||
@pytest.fixture | ||
def temp_work_dir(tmp_path, monkeypatch): | ||
monkeypatch.chdir(tmp_path) | ||
return tmp_path | ||
|
||
|
||
@pytest.fixture | ||
def hg_repo(temp_work_dir): | ||
repo = vcs.Mercurial() | ||
_ensure_present(repo) | ||
repo._invoke('init', '.') | ||
return repo | ||
|
||
|
||
@pytest.fixture | ||
def git_repo(temp_work_dir): | ||
repo = vcs.Git() | ||
_ensure_present(repo) | ||
repo._invoke('init') | ||
repo._invoke('config', 'user.email', 'vip@example.com') | ||
repo._invoke('config', 'user.name', 'Important User') | ||
return repo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Presented hg_repo and git_repo as fixtures. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters