Skip to content

Commit e0e07bf

Browse files
committed
Remove unneeded expect_stderr=True in some vcs tests.
1 parent bef5b2e commit e0e07bf

File tree

2 files changed

+16
-43
lines changed

2 files changed

+16
-43
lines changed

tests/functional/test_install_vcs_git.py

+13-40
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,7 @@ def test_git_with_sha1_revisions(script):
184184
'git', 'rev-parse', 'HEAD~1',
185185
cwd=version_pkg_path,
186186
).stdout.strip()
187-
version = _install_version_pkg(
188-
script, version_pkg_path, rev=sha1, expect_stderr=True,
189-
)
187+
version = _install_version_pkg(script, version_pkg_path, rev=sha1)
190188
assert '0.1' == version
191189

192190

@@ -200,9 +198,7 @@ def test_git_with_short_sha1_revisions(script):
200198
'git', 'rev-parse', 'HEAD~1',
201199
cwd=version_pkg_path,
202200
).stdout.strip()[:7]
203-
version = _install_version_pkg(
204-
script, version_pkg_path, rev=sha1, expect_stderr=True,
205-
)
201+
version = _install_version_pkg(script, version_pkg_path, rev=sha1)
206202
assert '0.1' == version
207203

208204

@@ -212,11 +208,7 @@ def test_git_with_branch_name_as_revision(script):
212208
"""
213209
version_pkg_path = _create_test_package(script)
214210
branch = 'test_branch'
215-
script.run(
216-
'git', 'checkout', '-b', branch,
217-
expect_stderr=True,
218-
cwd=version_pkg_path,
219-
)
211+
script.run('git', 'checkout', '-b', branch, cwd=version_pkg_path)
220212
_change_test_package_version(script, version_pkg_path)
221213
version = _install_version_pkg(script, version_pkg_path, rev=branch)
222214
assert 'some different version' == version
@@ -227,11 +219,7 @@ def test_git_with_tag_name_as_revision(script):
227219
Git backend should be able to install from tag names
228220
"""
229221
version_pkg_path = _create_test_package(script)
230-
script.run(
231-
'git', 'tag', 'test_tag',
232-
expect_stderr=True,
233-
cwd=version_pkg_path,
234-
)
222+
script.run('git', 'tag', 'test_tag', cwd=version_pkg_path)
235223
_change_test_package_version(script, version_pkg_path)
236224
version = _install_version_pkg(script, version_pkg_path, rev='test_tag')
237225
assert '0.1' == version
@@ -241,7 +229,7 @@ def _add_ref(script, path, ref):
241229
"""
242230
Add a new ref to a repository at the given path.
243231
"""
244-
script.run('git', 'update-ref', ref, 'HEAD', expect_stderr=True, cwd=path)
232+
script.run('git', 'update-ref', ref, 'HEAD', cwd=path)
245233

246234

247235
def test_git_install_ref(script):
@@ -253,7 +241,7 @@ def test_git_install_ref(script):
253241
_change_test_package_version(script, version_pkg_path)
254242

255243
version = _install_version_pkg(
256-
script, version_pkg_path, rev='refs/foo/bar', expect_stderr=True,
244+
script, version_pkg_path, rev='refs/foo/bar',
257245
)
258246
assert '0.1' == version
259247

@@ -267,14 +255,12 @@ def test_git_install_then_install_ref(script):
267255
_add_ref(script, version_pkg_path, 'refs/foo/bar')
268256
_change_test_package_version(script, version_pkg_path)
269257

270-
version = _install_version_pkg(
271-
script, version_pkg_path, expect_stderr=True,
272-
)
258+
version = _install_version_pkg(script, version_pkg_path)
273259
assert 'some different version' == version
274260

275261
# Now install the ref.
276262
version = _install_version_pkg(
277-
script, version_pkg_path, rev='refs/foo/bar', expect_stderr=True,
263+
script, version_pkg_path, rev='refs/foo/bar',
278264
)
279265
assert '0.1' == version
280266

@@ -388,13 +374,8 @@ def test_editable__branch_with_sha_same_as_default(script):
388374
"""
389375
version_pkg_path = _create_test_package(script)
390376
# Create a second branch with the same SHA.
391-
script.run(
392-
'git', 'branch', 'develop', expect_stderr=True,
393-
cwd=version_pkg_path,
394-
)
395-
_install_version_pkg_only(
396-
script, version_pkg_path, rev='develop', expect_stderr=True
397-
)
377+
script.run('git', 'branch', 'develop', cwd=version_pkg_path)
378+
_install_version_pkg_only(script, version_pkg_path, rev='develop')
398379

399380
branch = _get_editable_branch(script, 'version-pkg')
400381
assert branch == 'develop'
@@ -410,16 +391,11 @@ def test_editable__branch_with_sha_different_from_default(script):
410391
"""
411392
version_pkg_path = _create_test_package(script)
412393
# Create a second branch.
413-
script.run(
414-
'git', 'branch', 'develop', expect_stderr=True,
415-
cwd=version_pkg_path,
416-
)
394+
script.run('git', 'branch', 'develop', cwd=version_pkg_path)
417395
# Add another commit to the master branch to give it a different sha.
418396
_change_test_package_version(script, version_pkg_path)
419397

420-
version = _install_version_pkg(
421-
script, version_pkg_path, rev='develop', expect_stderr=True
422-
)
398+
version = _install_version_pkg(script, version_pkg_path, rev='develop')
423399
assert version == '0.1'
424400

425401
branch = _get_editable_branch(script, 'version-pkg')
@@ -437,10 +413,7 @@ def test_editable__non_master_default_branch(script):
437413
version_pkg_path = _create_test_package(script)
438414
# Change the default branch of the remote repo to a name that is
439415
# alphabetically after "master".
440-
script.run(
441-
'git', 'checkout', '-b', 'release', expect_stderr=True,
442-
cwd=version_pkg_path,
443-
)
416+
script.run('git', 'checkout', '-b', 'release', cwd=version_pkg_path)
444417
_install_version_pkg_only(script, version_pkg_path)
445418

446419
branch = _get_editable_branch(script, 'version-pkg')

tests/functional/test_vcs_git.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ def get_head_sha(script, dest):
1919

2020

2121
def checkout_ref(script, repo_dir, ref):
22-
script.run('git', 'checkout', ref, cwd=repo_dir, expect_stderr=True)
22+
script.run('git', 'checkout', ref, cwd=repo_dir)
2323

2424

2525
def checkout_new_branch(script, repo_dir, branch):
2626
script.run(
27-
'git', 'checkout', '-b', branch, cwd=repo_dir, expect_stderr=True,
27+
'git', 'checkout', '-b', branch, cwd=repo_dir,
2828
)
2929

3030

@@ -87,7 +87,7 @@ def test_get_remote_url(script, tmpdir):
8787
do_commit(script, source_dir)
8888

8989
repo_dir = str(tmpdir / 'repo')
90-
script.run('git', 'clone', source_url, repo_dir, expect_stderr=True)
90+
script.run('git', 'clone', source_url, repo_dir)
9191

9292
remote_url = Git.get_remote_url(repo_dir)
9393
assert remote_url == source_url

0 commit comments

Comments
 (0)