A jest runner for executing python tests.
Install with yarn or npm
yarn add --dev jest-python
npm install --save-dev jest-python
Install via pip/pip3
python3
pytest
pytest-json-report
Install via yarn (or npm)
yarn add --dev jest
npm install --save-dev jest
In your package.json
"jest": {
"runner": "jest-python",
"testMatch": [
"**/test_*.py"
],
"moduleFileExtensions": [
"py"
]
}
yarn jest
You can run tests in a pipenv shell.
In the project root create a .env
file.
Add a variable VIRTUALENV
assigned to the absolute path to the pipfile you wish to source.
VIRTUALENV=/Users/kai/projects/test-jest/Pipfile
jest-watch-typeahead
yarn add --dev jest-watch-typeahead
"jest": {
"runner": "jest-python",
"watchPlugins": [
"jest-watch-typeahead/filename",
"jest-watch-typeahead/testname"
],
"testMatch": [
"**/test_*.py"
],
"moduleFileExtensions": [
"py"
]
}```