If you want to write UnitTest when using stdin
in Python.
Pytest provide setattr
function in monkeypatch
|
|
Reference
- Monkeypatching/mocking modules and environments
- I want to use stdin in a pytest test
- https://gist.github.com/GenevieveBuckley/efd16862de9e2fe7adfd2bf2bef93e02
See Also
- 自走プログラマーを読み終えた
- Pythonの関数のデフォルト引数はmutable(上書きされる)
- 遅すぎる `pandas.read_gbq` を使わずに、Google BigQueryから高速にデータを読み込む
- Jupyter Notebook上にTensorboard を わずか2行で表示させる
- How to concat image using skimage