# HG changeset patch # User Mads Kiilerich # Date 2019-01-17 02:56:34 # Node ID 76e2072b88f6261792ab4e8093fb5478e25bb9f0 # Parent d89217cca11a24a8d752349deeca74eea6c4989f tests: push with force in test_vcs_operations.py _add_files_and_push Some tests push a fixed branch name. If such tests are run twice, it will fail second time when the other branch head already exists. Work around that by using force and thus replace the old head. diff --git a/kallithea/tests/other/test_vcs_operations.py b/kallithea/tests/other/test_vcs_operations.py --- a/kallithea/tests/other/test_vcs_operations.py +++ b/kallithea/tests/other/test_vcs_operations.py @@ -158,9 +158,9 @@ def _add_files_and_push(webserver, vt, d # PUSH it back stdout = stderr = None if vt.repo_type == 'hg': - stdout, stderr = Command(dest_dir).execute('hg push --verbose', clone_url, ignoreReturnCode=ignoreReturnCode) + stdout, stderr = Command(dest_dir).execute('hg push -f --verbose', clone_url, ignoreReturnCode=ignoreReturnCode) elif vt.repo_type == 'git': - stdout, stderr = Command(dest_dir).execute('git push --verbose', clone_url, "master", ignoreReturnCode=ignoreReturnCode) + stdout, stderr = Command(dest_dir).execute('git push -f --verbose', clone_url, "master", ignoreReturnCode=ignoreReturnCode) return stdout, stderr