asfaltboy / SublimeTestPlier

run python tests quickly from within a project
https://packagecontrol.io/packages/Test%20Plier
MIT License
10 stars 4 forks source link

Using the target `run_python_tests` makes `file_regex` stop working #27

Closed evandrocoan closed 5 years ago

evandrocoan commented 5 years ago

When I use this plugin and set the target run_python_tests, Sublime Text file_regex pattern stop working and I cannot double click on things. Example build system:

{
    "folders":
    [
        {
            "path": ".",
        }
    ],
    "build_systems":
    [
        {
            "name": "Run Project",
            "file_regex": "^\\d\\d:\\d\\d:\\d\\d:\\d\\d\\d.\\d\\d\\d\\d\\d\\d \\d.\\d\\de-\\d\\d - (\\w+(?:\\.\\w+(?!\\.\\w+:))*)[^:]+:(\\d+) - (.*)$",
            "shell": true,

            // only after commenting this, file_regex pattern starts working
            "target": "run_python_tests",

            "env": {"PYTHONIOENCODING": "utf8"},
            "syntax": "Packages/Text/Plain text.tmLanguage",
            "working_dir": "$project_path/source",
            "shell_cmd": "python unit_tests.py -v TestChomskyGrammar.test_grammarInvalidNonTerminalException -f",
        },
    ],
}
asfaltboy commented 5 years ago

Thanks for opening the issue @evandrocoan! Sadly, this seems to works fine for me ... here's a screenshot: image

If the same build works (and matches the regex) for you, outside of run_python_tests, then surely something must not match in the output. Are you using the Sublime ANSI plugin to parse color output? If you are, perhaps we're hiding some ANSI color escape characters which prevent the regex from matching?

If this isn't it, I would need your help to reproduce the issue. Please provide a short reproducible example that I can follow step-by-step to reach the same result.

Btw, forgot this feature even exists, thanks I'll start using it!

evandrocoan commented 5 years ago

Thanks for looking into it! I had retested it locally and figured out the problem was that I was caching the value of file_regex along with other things. Now I added a code to update the cache, except the values this package always changes.