mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
ui: Fix WSL check in open_browser (#8604)
* ui: Fix WSL check in `open_browser` * Update dvc/ui/__init__.py Co-authored-by: Peter Rowlands (변기호) <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: Peter Rowlands (변기호) <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
Peter Rowlands
pre-commit-ci[bot]
parent
af255a46b4
commit
b02855fb93
+3
-1
@@ -270,7 +270,9 @@ class Console:
|
||||
|
||||
path = Path(file).resolve()
|
||||
url = (
|
||||
relpath(path) if "Microsoft" in uname().release else path.as_uri()
|
||||
relpath(path)
|
||||
if "microsoft" in uname().release.lower()
|
||||
else path.as_uri()
|
||||
)
|
||||
|
||||
opened = webbrowser.open(url)
|
||||
|
||||
@@ -178,7 +178,7 @@ def test_plots_diff_open(tmp_dir, dvc, mocker, capsys, plots_data, auto_open):
|
||||
def test_plots_diff_open_WSL(tmp_dir, dvc, mocker, plots_data):
|
||||
mocked_open = mocker.patch("webbrowser.open", return_value=True)
|
||||
mocked_uname_result = mocker.MagicMock()
|
||||
mocked_uname_result.release = "Microsoft"
|
||||
mocked_uname_result.release = "microsoft"
|
||||
mocker.patch("platform.uname", return_value=mocked_uname_result)
|
||||
|
||||
cli_args = parse_args(
|
||||
|
||||
Reference in New Issue
Block a user