beeware / cricket

A GUI tool for running Python test suites.
BSD 3-Clause "New" or "Revised" License
213 stars 68 forks source link

Cricket doesn't run in a brew virtual env under OSX #22

Closed shadowmint closed 11 years ago

shadowmint commented 11 years ago

After launching, it displays the error:

/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: No module named cricket.unittest

Which isn't where it should be looking, because:

dougs-Mac-mini:chirp doug$ which cricket-unittest
/Users/doug/projects/games/chirp/py/bin/cricket-unittest

Looks like this is because the unit test module naively uses:

from cricket.model import Project

class UnittestProject(Project):

    def discover_commandline(self):
        "Command line: Discover all available tests in a project."
        return ['python', '-m', 'cricket.unittest.discoverer']

    def execute_commandline(self, labels):
        "Return the command line to execute the specified test labels"
        return ['python', '-m', 'cricket.unittest.executor'] + labels

When it's not certain that 'python' is the current python; perhaps this can be changed to sys.executable, to support 1) windows, and 2) virtualenv's that haven't been activated.

freakboy3742 commented 11 years ago

Thanks for the report -- I'll make this change as soon as I get a chance (or I'll accept any pull request that magically arrives :-)