(monkeypatch: pytest.MonkeyPatch)
| 71 | |
| 72 | |
| 73 | def test_run(monkeypatch: pytest.MonkeyPatch): |
| 74 | runned = False |
| 75 | |
| 76 | def mock_run(*args, **kwargs): |
| 77 | nonlocal runned |
| 78 | runned = True |
| 79 | assert args == ("arg",) |
| 80 | assert kwargs == {"kwarg": "kwarg"} |
| 81 | |
| 82 | driver = get_driver() |
| 83 | |
| 84 | with monkeypatch.context() as m: |
| 85 | m.setattr(driver, "run", mock_run) |
| 86 | nonebot.run("arg", kwarg="kwarg") |
| 87 | |
| 88 | assert runned |
| 89 | |
| 90 | |
| 91 | def test_get_bot(app: App, monkeypatch: pytest.MonkeyPatch): |
nothing calls this directly
no test coverage detected