├── README ├── setup.py └── nosegoat.py /README: -------------------------------------------------------------------------------- 1 | nosegoat 2 | -------- 3 | 4 | A plugin for the Nose testing framework that gives you more goat. 5 | 6 | author 7 | ------ 8 | 9 | matthewharrison@gmail.com 10 | 11 | license 12 | ------- 13 | 14 | PSF 15 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | from setuptools import setup 3 | 4 | setup(name='NoseGoat', 5 | version='0.1', 6 | author='Matt Harrison', 7 | author_email = 'matthewharrison@gmail.com', 8 | description = 'Use the goat Luke!', 9 | long_description = 'Nose Plugin for goat enableation', 10 | platforms = 'goats eat anything', 11 | url='https://github.com/mattharrison/NoseGoat', 12 | license = 'PSF', 13 | py_modules=['nosegoat'], 14 | install_requires = ['nose>=0.10.0'], 15 | entry_points = { 'nose.plugins.0.10': ['goat = nosegoat:GoatPlugin']}) 16 | -------------------------------------------------------------------------------- /nosegoat.py: -------------------------------------------------------------------------------- 1 | """ 2 | (c) copyright 2011 - matt harrison 3 | 4 | Licensed under PSF license 5 | """ 6 | import os 7 | import sys 8 | 9 | from nose.plugins import Plugin 10 | from nose.plugins.plugintest import run_buffered as run 11 | 12 | GOAT_1 = r""" 13 | /\\_//\ 14 | \(o o)/____ 15 | \-/ \ 16 | \ ____, / 17 | // || 18 | ^^ ^^""" 19 | 20 | GOAT_2 = r""" 21 | /\\//\ 22 | _____\(oo)/ 23 | / --\/ 24 | \ ____|| 25 | || || 26 | ^^ ^^""" 27 | 28 | class GoatPlugin(Plugin): 29 | enabled = True 30 | name = "goat-plugin" 31 | 32 | def options(self, parser, env=os.environ): 33 | parser.add_option('', '--no-goat', 34 | help='do not use the goat', 35 | action='store_true' 36 | ) 37 | 38 | def configure(self, options, conf): 39 | self.enabled = not options.no_goat 40 | 41 | def begin(self): 42 | sys.stderr.write(GOAT_1) 43 | 44 | if __name__ == '__main__': 45 | run(plugins=[GoatPlugin()]) 46 | 47 | --------------------------------------------------------------------------------