1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-06 15:46:57 +01:00
Files
openshift-docs/modules/serverless-testing-python-functions.adoc

32 lines
788 B
Plaintext
Raw Normal View History

2021-05-04 10:20:30 -05:00
// Module included in the following assemblies
//
// * /serverless/functions/serverless-developing-python-functions.adoc
[id="serverless-testing-python-functions_{context}"]
= Testing Python functions
Python functions can be tested locally on your computer. The default project contains a `test_func.py` file, which provides a simple unit test for functions.
.Prerequisites
* To run Python functions tests locally, you must install the required dependencies:
+
[source,terminal]
----
$ pip install -r requirements.txt
----
.Procedure
. After you have installed the dependencies, run the tests:
+
[source,terminal]
----
$ python3 test_func.py
----
[NOTE]
====
The default test framework for Python functions is `unittest`. You can use a different test framework if you prefer.
====