anki-code / anki-code/xonsh-awesome-cli-app

Add tests

未關閉
#2 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
good first issue
主要語言
Python
星號
10
分支
0
PR 合併指標
30 天內沒有已合併 PR

描述

To start:

* [Unit tests using xonsh syntax](https://github.com/xonsh/xonsh/discussions/5303#discussioncomment-8786332)
* [Xonsh tests](https://github.com/xonsh/xonsh/tree/main/tests)
* [Xxh Development Environment with tests](https://github.com/xxh/xxh/tree/7222c47482a8e46cbdf1eb23589f40962425a4a0/xde)
* [click tests](https://click.palletsprojects.com/en/8.1.x/testing/)

This is working but `result.output` is not captured:

```xsh
from click.testing import CliRunner
from xonsh_awesome_cli_app.cli import cli

def test_say():
runner = CliRunner()
result = runner.invoke(cli, ['--name', 'Peter', 'say', 'hello'])
# assert result.exit_code == 0
assert result.output == 'Peter say: hello\n'
```
```xsh
pytest tests/
```

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。