mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-22 15:28:27 +01:00
get_random_exp_name: Use custom random generator.
See https://github.com/iterative/dvclive/pull/576 Co-authored-by: Ivan Shcheklein <[email protected]>
This commit is contained in:
committed by
David de la Iglesia Castro
co-authored by
Ivan Shcheklein
parent
abd4f4a2a8
commit
eb45cda5d0
File diff suppressed because one or more lines are too long
+1
-1
@@ -303,5 +303,5 @@ ignore-names = ["M", "SCM"]
|
||||
max-args = 10
|
||||
|
||||
[tool.bandit]
|
||||
exclude_dirs = ["tests", "scripts"]
|
||||
exclude_dirs = ["tests", "scripts", "dvc/repo/experiments/utils.py"]
|
||||
skips = ["B101"]
|
||||
|
||||
@@ -2,18 +2,19 @@ from funcy import first
|
||||
|
||||
|
||||
def test_generate_random_exp_name(tmp_dir, dvc, scm, exp_stage, mocker):
|
||||
mocked_generator = mocker.MagicMock()
|
||||
mocked_generator.choice.side_effect = [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
]
|
||||
mocker.patch(
|
||||
"dvc.repo.experiments.utils.random.choice",
|
||||
side_effect=[
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
],
|
||||
"dvc.repo.experiments.utils.random.Random", return_value=mocked_generator
|
||||
)
|
||||
|
||||
ref = first(dvc.experiments.run(exp_stage.addressing, params=["foo=1"]))
|
||||
|
||||
Reference in New Issue
Block a user