Skip to content

Latest commit

 

History

History
84 lines (62 loc) · 2.41 KB

python.org

File metadata and controls

84 lines (62 loc) · 2.41 KB

run-command’s Recipe for Python

Table of Contents

Commands

Has 4 commands:
  • Just Run Current Python File
  • Run Current Python File Interactively (with flag -i) (you may find its here)
  • Run pytest in Current Pytest File
  • Run All Tests in Current Project via Pytest

Customization

Detect Python File

Variable run-command-recipes-python-modes is a list of major modes, in which this amazing recipe should work.

Function run-command-recipes-python-mode-p-function don’t accept arguments, return non-nil if in the current buffer should work run-command-recipes-python.

Detect Tests

Detect Single Test File

run-command-recipes-python-test-filename is regexp which match on Python test files. Defaults to

test_.*\.py

It matchs to following filenames, for example:

  • test_something.py
  • test_lll.py

run-command-recipes-python-test-buffer-p is predicate. It return t, when current file is Python test file

Detect Test Directory

run-command-recipes-python-tests-dirs is list of dirictories names in which should work pytest. Defautls to:

  • tests

Shell Commands

NOTE: in each of shell command may be used syntax that looks like on the following

pytest {file-name}

I suggest you visit standard library of run-command-recipes documentation before

run-command-recipes-python-run-command is shell command, which just run current Python file.

run-command-recipes-python-pytest-file-command is shell command which run pytest for current single test file.

run-command-recipes-python-interactively-run-command is shell command which run python on this file inIteractively.