Code Monkey home page Code Monkey logo

py-test.el's Introduction

py-test

py-test gives you the ability to define testing projects and, based on those projects, run a single test that's defined in the current buffer, all of the tests that you have defined in the current buffer, or all of the tests that you have defined in the current buffers's parent directory.

Installation

From MELPA

M-x package-install RET py-test RET

Manual

Clone the repo:

git clone https://github.com/Bogdanp/py-test.el ~/sandbox/py-test.el

Add it to your .emacs:

(add-to-list 'load-path (expand-file-name "~/sandbox/py-test.el"))

(require 'py-test)

Usage

Define a project.

(py-test-define-project
 :name "My Project"
 :python-command "python"
 :base-directory (expand-file-name "~/sandbox/my-project-home/")
 :test-runner (expand-file-name "~/sandbox/my-project-home/tests/runner.py")
 :working-directory (expand-file-name "~/sandbox/my-project-home/tests/"))

Open a file belonging to that project:

C-x C-f ~/sandbox/my-project-home/tests/subdirectory/test_something.py RET

Run all of the tests that were defined in that file:

M-x py-test-run-file RET

Run all of the tests that were defined in that file's parent directory (in this example, that would mean subdirectory):

M-x py-test-run-directory RET

Jump to a single test function, method or class and run just that:

M-x py-test-run-test-at-point RET

Extras

py-test is also configurable through the following variables (use describe-variable for more info):

  • py-test-*mode-line-face-shenanigans-on*
  • py-test-*mode-line-face-shenanigans-timer*
  • py-test-*default-buffer-name*
  • py-test-*default-test-runner*
  • py-test-*test-path-separator*

In addition, py-test defines the following faces:

  • py-test-*mode-line-green-face*
  • py-test-*mode-line-inactive-green-face*
  • py-test-*mode-line-red-face*
  • py-test-*mode-line-inactive-red-face*

py-test.el's People

Contributors

bogdanp avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.