This commit is contained in:
@@ -32,9 +32,9 @@ def test_run_at(monkeypatch, capsys):
|
||||
fake_dt = FakeDatetime(base)
|
||||
|
||||
# Patch dependencies to control time and disable delays
|
||||
monkeypatch.setattr("slic.utils.time_runner.datetime", fake_dt)
|
||||
monkeypatch.setattr("slic.utils.time_runner.sleep", lambda x: None)
|
||||
monkeypatch.setattr("slic.utils.time_runner.tqdm_mod", lambda *a, **k: DummyBar())
|
||||
monkeypatch.setattr("slic.utils.run_later.datetime", fake_dt)
|
||||
monkeypatch.setattr("slic.utils.run_later.sleep", lambda x: None)
|
||||
monkeypatch.setattr("slic.utils.run_later.tqdm_mod", lambda *a, **k: DummyBar())
|
||||
|
||||
# Should NOT trigger because the target time is in the future
|
||||
run_at(base + timedelta(seconds=30), fexample, "not yet")
|
||||
@@ -97,9 +97,9 @@ def test_run_later(monkeypatch, capsys):
|
||||
fake_dt = FakeDatetime(base)
|
||||
|
||||
# Patch for control over time and sleeping
|
||||
monkeypatch.setattr("slic.utils.time_runner.datetime", fake_dt)
|
||||
monkeypatch.setattr("slic.utils.time_runner.sleep", lambda x: None)
|
||||
monkeypatch.setattr("slic.utils.time_runner.tqdm_mod", lambda *a, **k: DummyBar())
|
||||
monkeypatch.setattr("slic.utils.run_later.datetime", fake_dt)
|
||||
monkeypatch.setattr("slic.utils.run_later.sleep", lambda x: None)
|
||||
monkeypatch.setattr("slic.utils.run_later.tqdm_mod", lambda *a, **k: DummyBar())
|
||||
|
||||
# Run using float seconds : should not trigger yet
|
||||
run_later(15, fexample, "15s later")
|
||||
|
||||
Reference in New Issue
Block a user