diff --git a/Default.sublime-commands b/Default.sublime-commands index 3506d21f..3d351d40 100644 --- a/Default.sublime-commands +++ b/Default.sublime-commands @@ -122,9 +122,5 @@ "file": "$packages/User/Package Control.user-ca-bundle", "semi_transient": true }, - }, - { - "caption": "Package Control: Tests", - "command": "package_control_tests" } ] diff --git a/Package Control.sublime-settings b/Package Control.sublime-settings index 90898aca..bb725d0a 100644 --- a/Package Control.sublime-settings +++ b/Package Control.sublime-settings @@ -286,7 +286,4 @@ ] } }, - - // Enable the ability to run the tests - this is only for development - "enable_tests": false } diff --git a/package_control/commands/__init__.py b/package_control/commands/__init__.py index 07bcfbff..2284a3d8 100644 --- a/package_control/commands/__init__.py +++ b/package_control/commands/__init__.py @@ -17,7 +17,6 @@ from .package_control_enable_debug_mode_command import PackageControlEnableDebugModeCommand from .package_control_insert_command import PackageControlInsertCommand from .package_control_message_command import PackageControlMessageCommand -from .package_control_tests_command import PackageControlTestsCommand from .remove_channel_command import RemoveChannelCommand from .remove_package_command import RemovePackageCommand from .remove_packages_command import RemovePackagesCommand @@ -50,7 +49,6 @@ 'PackageControlEnableDebugModeCommand', 'PackageControlInsertCommand', 'PackageControlMessageCommand', - 'PackageControlTestsCommand', 'RemoveChannelCommand', 'RemovePackageCommand', 'RemovePackagesCommand', diff --git a/package_control/commands/package_control_tests_command.py b/package_control/commands/package_control_tests_command.py deleted file mode 100644 index f443328d..00000000 --- a/package_control/commands/package_control_tests_command.py +++ /dev/null @@ -1,65 +0,0 @@ -import io -import os.path -import threading -import unittest - -import sublime -import sublime_plugin - -from ..settings import pc_settings_filename - - -class OutputPanel(io.TextIOWrapper): - """ - A TextIO wrapper to output test results in an output panel. - """ - - def __init__(self, window): - self.panel = window.get_output_panel("package_control_tests") - self.panel.settings().set("word_wrap", True) - self.panel.settings().set("scroll_past_end", False) - window.run_command("show_panel", {"panel": "output.package_control_tests"}) - - def write(self, data): - self.panel.run_command("package_control_insert", {"string": data}) - - def get(self): - pass - - def flush(self): - pass - - -class PackageControlTestsCommand(sublime_plugin.ApplicationCommand): - """ - A command to run the tests for Package Control - """ - - HAVE_TESTS = None - - def run(self): - def worker(): - package_root = os.path.join(sublime.packages_path(), "Package Control") - - # tests are excluded from production builds - # so it's ok to rely on filesystem traversal - suite = unittest.TestLoader().discover( - pattern="test_*.py", - start_dir=os.path.join(package_root, "package_control", "tests"), - top_level_dir=package_root, - ) - - output = OutputPanel(sublime.active_window()) - output.write("Running Package Control Tests\n\n") - - unittest.TextTestRunner(stream=output, verbosity=1).run(suite) - - threading.Thread(target=worker).start() - - def is_visible(self): - if self.HAVE_TESTS is None: - self.HAVE_TESTS = os.path.exists( - os.path.join(sublime.packages_path(), "Package Control", "package_control", "tests") - ) - - return self.HAVE_TESTS and sublime.load_settings(pc_settings_filename()).get("enable_tests", False) diff --git a/plugin.py b/plugin.py index c8d27ad0..7d686424 100644 --- a/plugin.py +++ b/plugin.py @@ -236,7 +236,6 @@ '.commands.package_control_enable_debug_mode_command', '.commands.package_control_insert_command', '.commands.package_control_message_command', - '.commands.package_control_tests_command', '.commands', '.automatic_upgrader',