Skip to content

Commit 2865ba8

Browse files
committed
Renaming variable in tests.
Also touching up Sphinx docs.
1 parent ba89978 commit 2865ba8

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

docs/github_pages.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Running in CI
5252
The goal of using GitHub Pages is to have docs automatically update on every new/changed branch/tag. In this example
5353
we'll be using Travis CI but any CI should work.
5454

55-
Travis won't be able to push any changes to the gh-pages branch without SSH keys. This guide will worry about just
55+
Travis won't be able to push any changes to the gh-pages branch without SSH keys. This section will worry about just
5656
getting Travis to run SCVersioning. It should only fail when trying to push to origin.
5757

5858
CI Config File
@@ -122,7 +122,7 @@ The ``travis encrypt-file`` command should have updated your ``.travis.yml`` wit
122122
we still need to make one more change to the file before committing it. Update .travis.yml to make the after_success
123123
section look like this:
124124

125-
.. code-block:: bash
125+
.. code-block:: yaml
126126
127127
after_success:
128128
- eval "$(ssh-agent -s)"; touch docs/key; chmod 0600 docs/key

tests/test__main__/test_main_push_scenarios.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -172,27 +172,27 @@ def test_second_remote(tmpdir, local_docs_ghp, run, urls):
172172
:param run: conftest fixture.
173173
:param urls: conftest fixture.
174174
"""
175-
# Error out because origin2 doesn't exist yet.
175+
# Error out because remote2 doesn't exist yet.
176176
with pytest.raises(CalledProcessError) as exc:
177-
run(local_docs_ghp, ['sphinx-versioning', 'push', '.', 'gh-pages', '.', '-P', 'origin2'])
177+
run(local_docs_ghp, ['sphinx-versioning', 'push', '.', 'gh-pages', '.', '-P', 'remote2'])
178178
assert 'Traceback' not in exc.value.output
179179
assert 'Failed to push to remote.' in exc.value.output
180-
assert "fatal: 'origin2' does not appear to be a git repository" in exc.value.output
180+
assert "fatal: 'remote2' does not appear to be a git repository" in exc.value.output
181181

182-
# Create origin2.
183-
origin2 = tmpdir.ensure_dir('origin2')
184-
run(origin2, ['git', 'init', '--bare'])
185-
run(local_docs_ghp, ['git', 'remote', 'add', 'origin2', origin2])
186-
run(local_docs_ghp, ['git', 'push', 'origin2', 'gh-pages'])
182+
# Create remote2.
183+
remote2 = tmpdir.ensure_dir('remote2')
184+
run(remote2, ['git', 'init', '--bare'])
185+
run(local_docs_ghp, ['git', 'remote', 'add', 'remote2', remote2])
186+
run(local_docs_ghp, ['git', 'push', 'remote2', 'gh-pages'])
187187

188188
# Run again.
189-
output = run(local_docs_ghp, ['sphinx-versioning', 'push', '.', 'gh-pages', '.', '-P', 'origin2'])
189+
output = run(local_docs_ghp, ['sphinx-versioning', 'push', '.', 'gh-pages', '.', '-P', 'remote2'])
190190
assert 'Traceback' not in output
191191
assert 'Successfully pushed to remote repository.' in output
192192

193193
# Check files.
194-
run(local_docs_ghp, ['git', 'checkout', 'origin2/gh-pages'])
195-
run(local_docs_ghp, ['git', 'pull', 'origin2', 'gh-pages'])
194+
run(local_docs_ghp, ['git', 'checkout', 'remote2/gh-pages'])
195+
run(local_docs_ghp, ['git', 'pull', 'remote2', 'gh-pages'])
196196
urls(local_docs_ghp.join('contents.html'), ['<li><a href="master/contents.html">master</a></li>'])
197197
urls(local_docs_ghp.join('master', 'contents.html'), ['<li><a href="contents.html">master</a></li>'])
198198
run(local_docs_ghp, ['git', 'checkout', 'origin/gh-pages'])

0 commit comments

Comments
 (0)