mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
refactor: dvc.daemon (#10045)
* minor refactor to dvc.daemon * fix tests * run daemon only inside a subprocess
This commit is contained in:
@@ -5,19 +5,11 @@ from dvc import daemon
|
||||
|
||||
|
||||
def test_daemon(mocker):
|
||||
mock_windows = mocker.patch("dvc.daemon._spawn_subprocess")
|
||||
mock_posix = mocker.patch("dvc.daemon._spawn_posix")
|
||||
mock = mocker.patch("dvc.daemon._spawn")
|
||||
daemon.daemon(["updater"])
|
||||
|
||||
if os.name == "nt":
|
||||
mock_posix.assert_not_called()
|
||||
mock_windows.assert_called()
|
||||
args = mock_windows.call_args[0]
|
||||
else:
|
||||
mock_windows.assert_not_called()
|
||||
mock_posix.assert_called()
|
||||
args = mock_posix.call_args[0]
|
||||
|
||||
mock.assert_called()
|
||||
args = mock.call_args[0]
|
||||
env = args[2]
|
||||
assert "PYTHONPATH" in env
|
||||
|
||||
|
||||
Reference in New Issue
Block a user