kaste / PyTest

pytest runner and view annotator for sublime text
21 stars 6 forks source link

Diagnose/resolve ST4 flash status bar (#28) #29

Closed jodylent closed 3 years ago

jodylent commented 3 years ago

Diagnosis

It seems that "something" used to call PytestExecCommand.finish(), which no longer does:

PackageResourceViewer's "Open Resource" allowed some low-tech hacking with print stmts in the console, which comprise the first commit of this PR.

git: located Sublime Merge installed at /Applications/Sublime Merge.app
git: using configuration from system git install
git: tracking working dir /Users/jlent/dev/
... <SNIP> ...
git: tracking working dir /Users/jlent/dev/jl_pytest
environment variables loaded using: /bin/zsh -l (21 skipped due to non-utf8 data)
reloading python 3.3 plugin 0_package_control_loader.00-package_control
... <SNIP> ...
reloading python 3.3 plugin Python Flake8 Lint.color_theme
reloading python 3.3 plugin Python Flake8 Lint.Flake8Lint
reloading python 3.3 plugin Python Flake8 Lint.lint
plugins loaded
Checking apply_theme_tweaks
TWEAKED THEME
Lint tools versions:
- Python Flake8 Lint: 2.4.3
- pep8: 1.7.0
- flake8: 2.5.2
- pyflakes: 1.0.0
- mccabe: 0.4.0
- pydocstyle: 1.0.0
- naming: 0.3.3
- debugger: 1.4.0
- import-order: 0.6.1
Package Control: No updated packages
TRYING TO PING
Run /Users/jlent/.pyenv/shims/pytest --tb=auto -l /Users/jlent/dev/jl_pytest/tests/find_test_under_cursor_test.py::testPasses
INSIDE Pytest Exec: START run
INSIDE Pytest Exec: BEFORE super run
INSIDE Pytest Exec: self.proc is None
INSIDE Pytest Exec: self.proc is <Default.exec.AsyncProcess object at 0x7fdad846de10>
INSIDE Pytest Exec: AFTER super run
INSIDE Pytest Exec: START finish
Pytest Finished
FLASHING: GREEN
FLASHING: pytest_is_green
FLASHED: pytest_is_green
SET TIMEOUT: pytest_is_green
INSIDE Pytest Exec: FINISH finish
INSIDE Pytest Exec: FINISH run

I went through several iterations of "print debugging" before discovering the locus of the issue, but the above seems to indicate possible changes in Default.exec.ExecCommand renaming .finish to .on_finished

Resolution

This single change is the full changeset after the SECOND commit (which undoes the print stmts):

diff --git a/pytest_exec.py b/pytest_exec.py
index ee88edd..ec9260f 100644
--- a/pytest_exec.py
+++ b/pytest_exec.py
@@ -57,8 +57,7 @@ class PytestExecCommand(exec.ExecCommand):
         from . import PyTest
         PyTest.State['pytest_view'] = self.output_view

-    def finish(self, proc):
-        super().finish(proc)
+    def on_finished(self, proc):

         view = self.output_view
         output = get_whole_text(view).strip()

The third commit adds a basic .gitignore to clean __pycache__ out of git status.

Testing

This PR "works on my machine" as-is. I have NOT tested it on SublimeText3 (though I can in the next day or two).

Hopefully it aids in debugging the issue

kaste commented 3 years ago

Good finding. They rewrote the Exec class. finish is now on_finished. But I also implement service_text_queue which is gone.

jodylent commented 3 years ago

Closed by #30