This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.11.7.5. Python 関数のテスト
Python 機能は、お使いのコンピューターのローカルにテストできます。デフォルトプロジェクトには、test_func.py
ファイルが含まれており、関数の単純なユニットテストを提供します。
注記
Python 関数のデフォルトのテストフレームワークは unittest
です。必要に応じて、別のテストフレームワークを使用できます。
前提条件
Python 関数テストをローカルで実行するには、必要な依存関係をインストールする必要があります。
pip install -r requirements.txt
$ pip install -r requirements.txt
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
手順
-
test_func.py
ファイルが含まれる関数のフォルダーに移動します。 テストを実行します。
python3 test_func.py
$ python3 test_func.py
Copy to Clipboard Copied! Toggle word wrap Toggle overflow