-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
60 additions
and
43 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
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
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 |
---|---|---|
|
@@ -17,6 +17,15 @@ | |
from jupyter_releaser.util import ensure_mock_github, run | ||
|
||
|
||
@fixture(autouse=True) | ||
def github_port(worker_id): | ||
# The worker id will be of the form "gw123" unless xdist is disabled, | ||
# in which case it will be "master". | ||
if worker_id == "master": | ||
return | ||
os.environ["MOCK_GITHUB_PORT"] = str(8000 + int(worker_id[2:])) | ||
|
||
|
||
@fixture(autouse=True) | ||
def mock_env(mocker): | ||
"""Clear unwanted environment variables""" | ||
|
@@ -29,13 +38,6 @@ def mock_env(mocker): | |
del env[key] | ||
|
||
mocker.patch.dict(os.environ, env, clear=True) | ||
|
||
try: | ||
run("git config --global user.name") | ||
except Exception: | ||
run("git config --global user.name snuffy") | ||
run("git config --global user.email [email protected]") | ||
|
||
yield | ||
|
||
|
||
|
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 |
---|---|---|
|
@@ -94,18 +94,19 @@ def test_prep_git_full(py_package, tmp_path, mocker, runner): | |
os.mkdir(util.CHECKOUT_NAME) | ||
|
||
runner(["prep-git"], env=env) | ||
|
||
mock_run.assert_has_calls( | ||
[ | ||
call("echo before-prep-git >> 'log.txt'"), | ||
call("git config --global user.email"), | ||
call("git init .jupyter_releaser_checkout"), | ||
call("git remote add origin https://snuffy:[email protected]/baz/bar.git"), | ||
call(f"{GIT_FETCH_CMD} --tags --force"), | ||
call(f"{GIT_FETCH_CMD} +refs/pull/42:refs/pull/42"), | ||
call(f"{GIT_FETCH_CMD} refs/pull/42"), | ||
call("git checkout -B foo refs/pull/42"), | ||
call("git symbolic-ref -q HEAD"), | ||
call("git config user.email"), | ||
call('git config user.email "[email protected]"', echo=True), | ||
call('git config user.name "snuffy"', echo=True), | ||
] | ||
) | ||
|
||
|
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