Skip to content

Commit

Permalink
Raise ImportError instead of exiting, if buildbot.test can't be impor…
Browse files Browse the repository at this point in the history
…ted.

This apparently causes issue with 'pydoc -k', and is in general not nice.
Trial still fails with a sensible error message.

This is a slave-side reflection of commit 126e023
  • Loading branch information
djmitche committed Dec 10, 2012
1 parent a061fea commit f65f8a9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions slave/buildslave/test/__init__.py
Expand Up @@ -14,7 +14,6 @@
# Copyright Buildbot Team Members

import sys
import os

import twisted
from twisted.trial import unittest
Expand Down Expand Up @@ -58,6 +57,5 @@ def nopatch(self, *args):
import mock
mock = mock
except ImportError:
print >>sys.stderr, ("\nBuildbot tests require the 'mock' module; "
"try 'pip install mock'")
os._exit(1)
raise ImportError("Buildbot tests require the 'mock' module; "
"try 'pip install mock'")

0 comments on commit f65f8a9

Please sign in to comment.