From 6f9deecbcf0e24e87031a768b92ee51d0f43ba0f Mon Sep 17 00:00:00 2001 From: James Lu Date: Mon, 25 Jun 2018 14:04:45 -0700 Subject: [PATCH] test_plugin_create: skip if supybot-plugin-create is not installed This is often the case when tests are run automatically as part of a package build process (e.g. in Debian). Reported by @unit193. --- test/test_plugin_create.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/test_plugin_create.py b/test/test_plugin_create.py index 73e421740..5e359fdb1 100644 --- a/test/test_plugin_create.py +++ b/test/test_plugin_create.py @@ -36,6 +36,11 @@ import os import shutil import compileall +try: + from shutil import which +except ImportError: # Python < 3.3 + from distutils.spawn import find_executable as which + TEST_PLUGIN_NAME = "TestPlugin" class PluginCreateTestCase(SupyTestCase): @@ -64,6 +69,12 @@ Dummy test plugin self._communicate(proc, cmdinput) def testPluginCreate(self): + if not which('supybot-plugin-create'): + # When tests are run automatically as part of a build process (e.g. in Debian), + # don't assume that the bot is installed yet. + print('Skipping supybot-plugin-create test because Limnoria has not been installed yet') + return + tmpdir = conf.supybot.directories.data.tmp() curdir = os.getcwd() try: