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

Add tests

Aperta
#2 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
good first issue
Lingua principale
Python
Stelle
10
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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/
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.