jest-python

1.0.5 • Public • Published

jest-python

A jest runner for executing python tests.

expo runner

Setup

Install

Install with yarn or npm

yarn add --dev jest-python
npm install --save-dev jest-python

Requirements

Python dependencies

Install via pip/pip3

python3
pytest
pytest-json-report

Node dependencies

Install via yarn (or npm)

yarn add --dev jest
npm install --save-dev jest

Add jest-python as the jest runner

In your package.json

"jest": {
    "runner": "jest-python",
    "testMatch": [
      "**/test_*.py"
    ],
    "moduleFileExtensions": [
      "py"
    ]
  }

Run

Run Jest

yarn jest

Run with pipenv

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

Demonstration config

Extra dependencies

jest-watch-typeahead

yarn add --dev jest-watch-typeahead

Config used

"jest": {
    "runner": "jest-python",
    "watchPlugins": [
      "jest-watch-typeahead/filename",
      "jest-watch-typeahead/testname"
    ],
    "testMatch": [
      "**/test_*.py"
    ],
    "moduleFileExtensions": [
      "py"
    ]
  }```

Readme

Keywords

none

Package Sidebar

Install

npm i jest-python

Weekly Downloads

35

Version

1.0.5

License

MIT

Unpacked Size

10.1 MB

Total Files

19

Last publish

Collaborators

  • kaispencer