monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fb79f1e8438>
def test_clone_timeout(monkeypatch):
src = "https://www.mercurial-scm.org/repo/hello"
dest = "/dev/null"
timeout = 0.1
def clone(*args, **kwargs):
# ignore SIGTERM to force sigkill
signal.signal(signal.SIGTERM, lambda signum, frame: None)
time.sleep(2)
monkeypatch.setattr(hg, "clone", clone)
with pytest.raises(hgutil.CloneTimeout) as e:
hgutil.clone(src, dest, timeout)
killed = True
> assert e.value.args == (src, timeout, killed)
E AssertionError: assert ('https://www...', 0.1, False) == ('https://www...o', 0.1, True)
E At index 2 diff: False != True
E Full diff:
E - ('https://www.mercurial-scm.org/repo/hello', 0.1, True)
E ? ^^^
E + ('https://www.mercurial-scm.org/repo/hello', 0.1, False)
E ? ^^^^
.tox/py3/lib/python3.7/site-packages/swh/loader/mercurial/tests/test_hgutil.py:30: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Jul 28 2021, 10:54 AM