mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/asottile/pyupgrade: v3.9.0 → v3.10.1](https://github.com/asottile/pyupgrade/compare/v3.9.0...v3.10.1) - [github.com/astral-sh/ruff-pre-commit: v0.0.278 → v0.0.281](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.278...v0.0.281) - [github.com/PyCQA/flake8: 6.0.0 → 6.1.0](https://github.com/PyCQA/flake8/compare/6.0.0...6.1.0) * fix issues reported by ruff - also remove redundant flake8 plugins - remove beautysh as we don't have any scripts now - remove pyupgrade as it is redundant due to ruff --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Saugat Pachhai (सौगात) <[email protected]>
45 lines
1.1 KiB
Python
45 lines
1.1 KiB
Python
import pytest
|
|
|
|
# pylint: disable-next=unused-argument
|
|
from tests.unit.repo.experiments.conftest import ( # noqa: F401
|
|
exp_stage,
|
|
failed_exp_stage,
|
|
session_app,
|
|
session_queue,
|
|
session_worker,
|
|
test_queue,
|
|
)
|
|
|
|
|
|
@pytest.fixture
|
|
def http_auth_patch(mocker):
|
|
from dulwich.client import HTTPUnauthorized
|
|
|
|
url = "https://0.0.0.0"
|
|
client = mocker.MagicMock()
|
|
client.get_refs.side_effect = HTTPUnauthorized("", url)
|
|
client.send_pack.side_effect = HTTPUnauthorized("", url)
|
|
|
|
patch = mocker.patch("dulwich.client.get_transport_and_path")
|
|
patch.return_value = (client, url)
|
|
return url
|
|
|
|
|
|
@pytest.fixture(params=[True, False])
|
|
def workspace(request, session_queue) -> bool: # noqa: F811
|
|
return request.param
|
|
|
|
|
|
@pytest.fixture
|
|
def params_repo(tmp_dir, scm, dvc):
|
|
(tmp_dir / "params.yaml").dump(
|
|
{"foo": [{"bar": 1}, {"baz": 2}], "goo": {"bag": 3.0}, "lorem": False}
|
|
)
|
|
dvc.run(
|
|
cmd="echo foo",
|
|
params=["params.yaml:"],
|
|
name="foo",
|
|
)
|
|
scm.add(["dvc.yaml", "dvc.lock", "copy.py", "params.yaml"])
|
|
scm.commit("init")
|