{"id":20905071,"url":"https://github.com/kaste/pytest","last_synced_at":"2025-05-13T05:31:06.022Z","repository":{"id":46032133,"uuid":"77918399","full_name":"kaste/PyTest","owner":"kaste","description":"pytest runner and view annotator for sublime text","archived":false,"fork":false,"pushed_at":"2024-04-21T15:43:52.000Z","size":4750,"stargazers_count":23,"open_issues_count":11,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-01T18:21:25.821Z","etag":null,"topics":["pytest","sublime-text-plugin"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kaste.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-03T13:14:15.000Z","updated_at":"2025-03-17T04:32:32.000Z","dependencies_parsed_at":"2024-04-21T17:23:18.545Z","dependency_job_id":"3109892d-3197-4ebb-ad0a-0f5ead86948f","html_url":"https://github.com/kaste/PyTest","commit_stats":null,"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaste%2FPyTest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaste%2FPyTest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaste%2FPyTest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaste%2FPyTest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaste","download_url":"https://codeload.github.com/kaste/PyTest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253882840,"owners_count":21978554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pytest","sublime-text-plugin"],"created_at":"2024-11-18T13:21:36.069Z","updated_at":"2025-05-13T05:31:01.462Z","avatar_url":"https://github.com/kaste.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# py.test integration for Sublime Text\n\nThis plugin runs your tests and on failure annotates your files using the tracebacks.\n\n# Common Workflow\n\nThe defaults: it will run your tests on save; it will not show an output panel but annotate your views on failures instead. Like so:\n\n![annotated view showing phantom](phantom.jpg)\n\nWhich 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`](https://github.com/kaste/PyTest/blob/master/Default.sublime-commands) for some examples.\n\n# Config\n\nAt least **look** at the [global settings](https://github.com/kaste/PyTest/blob/master/PyTest.sublime-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.\n\n    \"pytest\": \"~/venvs/{project_base_name}/bin/py.test\"\n    OR:\n    \"pytest\": \".env\\\\Scripts\\\\py.test\"\n    OR even:\n    \"pytest\": [\"venv/path/to/python\", \"-m\", \"pytest\"]\n\n\nThe plugin will expand ${project_path}, ${project_base_name}, ${file}, etc. as usual. It will respect your `project-settings` like:\n\n    {\n      \"folders\":\n      [\n        {\n          \"path\": \".\"\n        }\n      ],\n      \"settings\": {\n        \"PyTest\": {\n          \"mode\": \"auto\",\n          \"options\": \"--tb=short -l -ff\",\n        },\n      }\n    }\n\nYou probably should add a keybinding to show/hide the output panel quickly. You could use [TogglePanel](https://github.com/kaste/TogglePanel) as well, but this one also brings the keyboard focus to the panel.\n\n    { \"keys\": [\"ctrl+'\"], \"command\": \"pytest_toggle_panel\" },\n\nMaybe a keybinding to run only the test under the cursor(s) as well:\n\n    { \"keys\": [\"ctrl+shift+'\"], \"command\": \"pytest_run_test_under_cursor\"},\n\nBut that command is also available via the context menu.\n\nThe third most useful keybinding could be\n\n    { \"keys\": [\"ctrl+alt+'\"], \"command\": \"pytest_toggle_phantoms\"},\n\nto 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.\n\nYou 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).\n\n# Install\n\nEnd-users should just do the normal install using `Package Control` searching for `PyTest`.\n\nHackers 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`.\n\nYou can go fancy of course, and add this repo to `Package Control`.\n\n1. 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.\n2. Open up the command palette again and find `Package Control: Install Package`, and just search for `PyTest`. (just a normal install)\n\n# Manual Theme Tweaking\n\nThe 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\n\n    {\n        \"class\": \"status_bar\",\n        \"settings\": [\"pytest_is_red\"],\n        \"layer0.tint\": [155, 7, 8], // -RED\n    },\n\nto your `.sublime-theme` to flash the status bar early if there are failures.\n\nLikewise, add\n\n    {\n        \"class\": \"status_bar\",\n        \"settings\": [\"pytest_is_green\"],\n        \"layer0.tint\": [8, 131, 8], // -GREEN\n    },\n    {\n        \"class\": \"label_control\",\n        \"settings\": [\"pytest_is_green\"],\n        \"parents\": [{\"class\": \"status_bar\"}],\n        \"color\": [19, 21, 32],\n    },\n\nto 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](https://github.com/buymeasoda/soda-theme/wiki/Theme-customisation#customisation-setup).\n\n# Mandatory GIF\n\n![common workflow](fanNq0wlXn.gif)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaste%2Fpytest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaste%2Fpytest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaste%2Fpytest/lists"}