Skip to content

Commit

Permalink
Merge pull request iterative#3140 from pared/2896_stage_unit
Browse files Browse the repository at this point in the history
stage: tests: unit: migrate to dir helpers
  • Loading branch information
efiop authored Jan 14, 2020
2 parents 6781a53 + 8e756f0 commit e7626b8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/unit/test_stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,24 +93,24 @@ def test_stage_update(mocker):
not isinstance(threading.current_thread(), threading._MainThread),
reason="Not running in the main thread.",
)
def test_stage_run_ignore_sigint(dvc_repo, mocker):
def test_stage_run_ignore_sigint(dvc, mocker):
proc = mocker.Mock()
communicate = mocker.Mock()
proc.configure_mock(returncode=0, communicate=communicate)
popen = mocker.patch.object(subprocess, "Popen", return_value=proc)
signal_mock = mocker.patch("signal.signal")

dvc_repo.run(cmd="path")
dvc.run(cmd="path")

assert popen.called_once()
assert communicate.called_once_with()
signal_mock.assert_any_call(signal.SIGINT, signal.SIG_IGN)
assert signal.getsignal(signal.SIGINT) == signal.default_int_handler


def test_always_changed(dvc_repo):
stage = Stage(dvc_repo, "path", always_changed=True)
def test_always_changed(dvc):
stage = Stage(dvc, "path", always_changed=True)
stage.save()
with dvc_repo.lock:
with dvc.lock:
assert stage.changed()
assert stage.status()["path"] == ["always changed"]

0 comments on commit e7626b8

Please sign in to comment.