mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
replace exception catch with signal
This commit is contained in:
@@ -324,10 +324,15 @@ class TestCmdRun(TestDvc):
|
||||
self.assertEqual(stage.cmd, 'echo "foo bar"')
|
||||
|
||||
@mock.patch.object(subprocess, "Popen", side_effect=KeyboardInterrupt)
|
||||
def test_keyboard_interrupt(self, _):
|
||||
def test_keyboard_interrupt_before_communicate(self, _):
|
||||
ret = main(["run", "mycmd"])
|
||||
self.assertEqual(ret, 252)
|
||||
|
||||
@mock.patch.object(subprocess.Popen, "wait", new=KeyboardInterrupt)
|
||||
def test_keyboard_interrupt_during_communicate(self):
|
||||
ret = main(["run", "python", "code.py"])
|
||||
self.assertEqual(ret, 1)
|
||||
|
||||
|
||||
class TestRunRemoveOuts(TestDvc):
|
||||
def test(self):
|
||||
|
||||
Reference in New Issue
Block a user