Пример #1
0
    def test_waitonchange(self, tmpdir, monkeypatch):
        tmp = tmpdir
        sd = StatRecorder([tmp])

        l = [True, False]
        monkeypatch.setattr(StatRecorder, 'check', lambda self: l.pop())
        sd.waitonchange(checkinterval=0.2)
        assert not l
Пример #2
0
    def test_waitonchange(self, tmpdir, monkeypatch):
        tmp = tmpdir
        sd = StatRecorder([tmp])

        l = [True, False]
        monkeypatch.setattr(StatRecorder, 'check', lambda self: l.pop())
        sd.waitonchange(checkinterval=0.2)
        assert not l
Пример #3
0
    def test_waitonchange(self, tmpdir, monkeypatch):
        tmp = tmpdir
        sd = StatRecorder([tmp])

        ret_values = [True, False]
        monkeypatch.setattr(StatRecorder, "check",
                            lambda self: ret_values.pop())
        sd.waitonchange(checkinterval=0.2)
        assert not ret_values
Пример #4
0
    def test_waitonchange(self, tmp_path: Path,
                          monkeypatch: pytest.MonkeyPatch) -> None:
        tmp = tmp_path
        sd = StatRecorder([py.path.local(tmp)])

        ret_values = [True, False]
        monkeypatch.setattr(StatRecorder, "check",
                            lambda self: ret_values.pop())
        sd.waitonchange(checkinterval=0.2)
        assert not ret_values