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

Add tests

オープン
#2 コメント 0 件 リアクション 0 件 担当者 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 を短くまとめたダイジェスト。