Sublime: Customize your own build system

New Build System
{
    "cmd": ["python", "-m", "unittest", "-v", "$file"],
    "selector": "source.python",
    "file_regex": "^\\s*File \"(...*?)\", line ([0-9]*)"
}

Making use of the build system customization in Sublime enables a python unit test build. These are the key names with respective implications:

  • cmd
    A list of strings specifying the executable to run, plus any arguments to pass to it.

  • selector
    The base scope name of the syntax that this build system should be enabled for.

  • file_regex
    A string containing a regular expression to run on the build output to match file information. The matched file information is used to enable result navigation. The regex should capture 2, 3 or 4 groups. The capture groups should be:

    • filename
    • line number
    • column number
    • message

Reference

Build Systems
Unit testing framework

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容