All Projects → kaste → PyTest

kaste / PyTest

Licence: other
pytest runner and view annotator for sublime text 3

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to PyTest

overhave
Web-framework for BDD: scalable, configurable, easy to use, based on Flask Admin and Pydantic.
Stars: ✭ 61 (+205%)
Mutual labels:  pytest
pytest-embedded
A pytest plugin that designed for embedded testing
Stars: ✭ 40 (+100%)
Mutual labels:  pytest
Plist-Binary sublime
De/Encode .plist files between XML and binary format
Stars: ✭ 18 (-10%)
Mutual labels:  sublime-text-plugin
pylint-pytest
A Pylint plugin to suppress pytest-related false positives.
Stars: ✭ 2 (-90%)
Mutual labels:  pytest
flask for startups
Flask boilerplate using a services oriented structure
Stars: ✭ 210 (+950%)
Mutual labels:  pytest
nbcelltests
Cell-by-cell testing for production Jupyter notebooks in JupyterLab
Stars: ✭ 66 (+230%)
Mutual labels:  pytest
web-ui
python+selenium+pytest+allure UI 自动化框架
Stars: ✭ 199 (+895%)
Mutual labels:  pytest
SublimeDiscordRP
📄 Discord rich presence for Sublime Text
Stars: ✭ 123 (+515%)
Mutual labels:  sublime-text-plugin
universe-topology
A universal computer knowledge topology for all the programmers worldwide.
Stars: ✭ 47 (+135%)
Mutual labels:  pytest
DXMate
Sublime Text 3 plugin to provide integration with the Salesforce DX CLI
Stars: ✭ 14 (-30%)
Mutual labels:  sublime-text-plugin
pytest-kind
Mirror of pytest-kind: Test your Python Kubernetes app/operator end-to-end with kind and pytest
Stars: ✭ 16 (-20%)
Mutual labels:  pytest
pytest-envvars
Pytest plugin to validate use of envvars on your tests
Stars: ✭ 21 (+5%)
Mutual labels:  pytest
pytest-variables
Plugin for providing variables to pytest tests/fixtures
Stars: ✭ 69 (+245%)
Mutual labels:  pytest
sublime rainbow csv
🌈Rainbow CSV - Sublime Text Package: Highlight columns in CSV and TSV files and run queeries in SQL-like language
Stars: ✭ 97 (+385%)
Mutual labels:  sublime-text-plugin
pygments-pytest
A pygments lexer for pytest output
Stars: ✭ 23 (+15%)
Mutual labels:  pytest
Semantic-Textual-Similarity
Natural Language Processing using NLTK and Spacy
Stars: ✭ 30 (+50%)
Mutual labels:  pytest
MacroUtils
MacroUtils is a collection of high-level APIs in order to make your life easier when writing STAR-CCM+ JAVA macros.
Stars: ✭ 32 (+60%)
Mutual labels:  pytest
Python-Studies
All studies about python
Stars: ✭ 56 (+180%)
Mutual labels:  pytest
continuous-integration-with-python
How to test your python code. How to automatically run your tests for your Python code. How to get reports of the tests coverage
Stars: ✭ 25 (+25%)
Mutual labels:  pytest
pytest-datafiles
pytest plugin to create a tmpdir containing a preconfigured set of files and/or directories.
Stars: ✭ 75 (+275%)
Mutual labels:  pytest

py.test integration for Sublime Text

This plugin runs your tests and on failure annotates your files using the tracebacks.

Common Workflow

The defaults: it will run your tests on save; it will not show an output panel but annotate your views on failures instead. Like so:

annotated view showing phantom

Which test it will run depends on the red/green status of the previous run, and if you're currently editing a test file or an implementation file. It should work really okay. Set "mode": "manual" and just use your own key bindings if you think that's stupid. See Default.sublime-commands for some examples.

Config

At least look at the global settings. You usually have to edit the pytest setting to point at your py.test from your current virtualenv (the default is to run your global py.test which is usually not what you want). E.g.

"pytest": "~/venvs/{project_base_name}/bin/py.test"
OR:
"pytest": ".env\\Scripts\\py.test"
OR even:
"pytest": ["venv/path/to/python", "-m", "pytest"]

The plugin will expand ${project_path}, ${project_base_name}, ${file}, etc. as usual. It will respect your project-settings like:

{
  "folders":
  [
    {
      "path": "."
    }
  ],
  "settings": {
    "PyTest": {
      "mode": "auto",
      "options": "--tb=short -l -ff",
    },
  }
}

You probably should add a keybinding to show/hide the output panel quickly. You could use TogglePanel as well, but this one also brings the keyboard focus to the panel.

{ "keys": ["ctrl+'"], "command": "pytest_toggle_panel" },

Maybe a keybinding to run only the test under the cursor(s) as well:

{ "keys": ["ctrl+shift+'"], "command": "pytest_run_test_under_cursor"},

But that command is also available via the context menu.

The third most useful keybinding could be

{ "keys": ["ctrl+alt+'"], "command": "pytest_toggle_phantoms"},

to quickly show/hide the annotations (in sublime parlance 'phantoms') b/c they can get quite annoying and in your way if you have a lot of failures or generally large tracebacks.

You can disable this plugin via a command (ctrl+shift+p and start typing pytest deactivate). This setting will then be persisted in your project settings (if any).

Install

End-users should just do the normal install using Package Control searching for PyTest.

Hackers can manually download/clone from github and put it in your Packages directory. You have to run Package Control: Satisfy Dependencies after that to pull in lxml.

You can go fancy of course, and add this repo to Package Control.

  1. Open up the command palette (ctrl+shift+p), and find Package Control: Add Repository. Then enter the URL of this repo: https://github.com/kaste/PyTest in the input field.
  2. Open up the command palette again and find Package Control: Install Package, and just search for PyTest. (just a normal install)

Manual Theme Tweaking

The plugin tries to tweak your theme so that you get a green/red notification after each test run. (You can disable this via the settings.) If this doesn't work out, consider a manual tweak: you really should add

{
    "class": "status_bar",
    "settings": ["pytest_is_red"],
    "layer0.tint": [155, 7, 8], // -RED
},

to your .sublime-theme to flash the status bar early if there are failures.

Likewise, add

{
    "class": "status_bar",
    "settings": ["pytest_is_green"],
    "layer0.tint": [8, 131, 8], // -GREEN
},
{
    "class": "label_control",
    "settings": ["pytest_is_green"],
    "parents": [{"class": "status_bar"}],
    "color": [19, 21, 32],
},

to get a status bar notification if we're green. Add these styles at the end of your theme file, at least they must come after the default status_bar styles because these styles are generally applied top-down. Read more about how to customize a theme here.

Mandatory GIF

common workflow

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].