Skip to content

Commit a03fb3e

Browse files
committed
TST: Try not to fail after rename
1 parent 53e12c4 commit a03fb3e

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

asv/repo.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ class NoRepository(Repo):
230230
"""
231231

232232
dvcs = "none"
233-
_default_branch = "main"
233+
_default_branch = "master"
234234

235235
def __init__(self, url=None, path=None):
236236
self.url = None

asv/util.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1279,8 +1279,8 @@ def git_default_branch():
12791279
[which('git'), 'config', '--system', 'init.defaultBranch'],
12801280
display_error=False).strip()
12811281
except ProcessError:
1282-
# Default to main when global and system are not set
1283-
default_branch = 'main'
1282+
# Default to master when global and system are not set
1283+
default_branch = 'master'
12841284
return default_branch
12851285

12861286

test/conftest.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def two_branch_repo_case(request, tmpdir):
150150
|
151151
| o Revision 5 (stable)
152152
| |
153-
| o Merge main
153+
| o Merge master
154154
|/|
155155
o | Revision 4
156156
| |
@@ -166,30 +166,30 @@ def two_branch_repo_case(request, tmpdir):
166166
dvcs_type = request.param
167167
tmpdir = str(tmpdir)
168168
if dvcs_type == "git":
169-
main = f"{util.git_default_branch()}"
169+
master = f"{util.git_default_branch()}"
170170
elif dvcs_type == "hg":
171-
main = "default"
171+
master = "default"
172172
dvcs = tools.generate_repo_from_ops(tmpdir, dvcs_type, [
173173
("commit", 1),
174-
("checkout", "stable", main),
174+
("checkout", "stable", master),
175175
("commit", 2),
176-
("checkout", main),
176+
("checkout", master),
177177
("commit", 3),
178178
("merge", "stable"),
179179
("commit", 4),
180180
("checkout", "stable"),
181-
("merge", main, "Merge main"),
181+
("merge", master, "Merge master"),
182182
("commit", 5),
183-
("checkout", main),
183+
("checkout", master),
184184
("commit", 6),
185185
])
186186

187187
conf = config.Config()
188-
conf.branches = [main, "stable"]
188+
conf.branches = [master, "stable"]
189189
conf.repo = dvcs.path
190190
conf.project = join(tmpdir, "repo")
191191
r = repo.get_repo(conf)
192-
return dvcs, main, r, conf
192+
return dvcs, master, r, conf
193193

194194

195195
@pytest.fixture
@@ -354,7 +354,7 @@ def benchmarks_fixture(tmpdir):
354354
d['env_dir'] = "env"
355355
d['benchmark_dir'] = 'benchmark'
356356
d['repo'] = tools.generate_test_repo(tmpdir, [0]).path
357-
d['branches'] = ["main"]
357+
d['branches'] = ["master"]
358358
conf = config.Config.from_json(d)
359359

360360
repo = get_repo(conf)

test/test_repo.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def test_get_branch_commits(two_branch_repo_case):
215215
],
216216
"stable": [
217217
"Revision 5",
218-
"Merge main",
218+
"Merge master",
219219
"Revision 2",
220220
"Revision 1",
221221
],
@@ -230,18 +230,18 @@ def test_get_branch_commits(two_branch_repo_case):
230230

231231
@pytest.mark.parametrize("existing, expected", [
232232
# No existing commit, we expect all commits in commit order,
233-
# main branch first
233+
# master branch first
234234
([], ["Revision 6", "Revision 4", "Merge stable", "Revision 3",
235-
"Revision 1", "Revision 5", "Merge main", "Revision 2"]),
235+
"Revision 1", "Revision 5", "Merge master", "Revision 2"]),
236236
237237
# New commits on each branch
238-
(["Revision 4", "Merge main"], ["Revision 6", "Revision 5"]),
238+
(["Revision 4", "Merge master"], ["Revision 6", "Revision 5"]),
239239
240240
# No new commits
241241
(["Revision 6", "Revision 5"], []),
242242
243243
# Missing all commits on one branch (case of new branch added in config)
244-
(["Revision 6"], ["Revision 5", "Merge main", "Revision 2", "Revision 1"]),
244+
(["Revision 6"], ["Revision 5", "Merge master", "Revision 2", "Revision 1"]),
245245
], ids=["all", "new", "no-new", "new-branch-added-in-config"])
246246
def test_get_new_branch_commits(two_branch_repo_case, existing, expected):
247247
dvcs, main, r, conf = two_branch_repo_case

test/test_workflow.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def test_run_publish(capfd, basic_conf):
106106
filename = glob.glob(join(tmpdir, 'html', 'graphs', 'arch-x86_64',
107107
'asv_dummy_test_package_1',
108108
'asv_dummy_test_package_2-' + tools.DUMMY2_VERSIONS[1],
109-
'branch-main',
109+
'branch-master',
110110
'cpu-Blazingly fast',
111111
'env-SOME_TEST_VAR-1',
112112
'machine-orangutan',

0 commit comments

Comments
 (0)