Skip to content

Commit

Permalink
Patch ST4
Browse files Browse the repository at this point in the history
  • Loading branch information
gerardroche committed Sep 26, 2022
1 parent 7c1c82e commit b28ce3d
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions unittesting/current.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,14 @@ def run(self, **kwargs):

def unit_testing(self, stream, package, settings):
parent = super(UnitTestingCurrentPackageCommand, self)
if settings["reload_package_on_testing"]:
self.reload_package(
package, dummy=True, show_reload_progress=settings["show_reload_progress"])

# Reloading seems broken in ST4
# https://github.com/SublimeText/UnitTesting/issues/186#issuecomment-687585639
if int(sublime.version()) < 4000:
if settings["reload_package_on_testing"]:
# sublime.active_window().run_command('package_reloader_reload')
self.reload_package(
package, dummy=True, show_reload_progress=settings["show_reload_progress"])

sublime.set_timeout(lambda: parent.unit_testing(stream, package, settings))

Expand Down Expand Up @@ -83,9 +88,14 @@ def unit_testing(self, stream, package, settings):
# ideally, we should reuse same function in UnitTestingCurrentPackageCommand
# but it is easier to copy it to here
parent = super(UnitTestingCurrentFileCommand, self)
if settings["reload_package_on_testing"]:
self.reload_package(
package, dummy=True, show_reload_progress=settings["show_reload_progress"])

# Reloading seems broken in ST4
# https://github.com/SublimeText/UnitTesting/issues/186#issuecomment-687585639
if int(sublime.version()) < 4000:
if settings["reload_package_on_testing"]:
# sublime.active_window().run_command('package_reloader_reload')
self.reload_package(
package, dummy=True, show_reload_progress=settings["show_reload_progress"])

sublime.set_timeout(lambda: parent.unit_testing(stream, package, settings))

Expand Down

0 comments on commit b28ce3d

Please sign in to comment.