Mercurial > nose_notify
changeset 0:f625999d7c09 v0.1
Beginning of the project
author | waltercruz |
---|---|
date | Thu, 28 Feb 2008 18:59:47 -0300 |
parents | |
children | 85ebb726f031 |
files | notify_test.py run_nose.py |
diffstat | 2 files changed, 44 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/notify_test.py Thu Feb 28 18:59:47 2008 -0300 @@ -0,0 +1,39 @@ +import sys +from nose.plugins.base import Plugin + +from StringIO import StringIO + +import pygtk +pygtk.require('2.0') +import pynotify +from new import instancemethod + +def writeln(self,*args): + for i in args: + self.write(i) + self.write("\n") + +class NotifyPlugin(Plugin): + + enabled = True + score = 1000 + name = "NotifyPlugin" + + def __init__(self): + self.stdout = [] + self._buf = StringIO() + self._buf.writeln = instancemethod(writeln,self._buf,StringIO) + + def configure(self, options, conf): + pass + + def options(self, parser, env): + pass + + def finalize(self, result): + result.stream = self._buf + result.printSummary(0,2) + pynotify.init("Basics") + n = pynotify.Notification("Tests", self._buf.getvalue()) + n.show() + return None \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run_nose.py Thu Feb 28 18:59:47 2008 -0300 @@ -0,0 +1,5 @@ +import unittest +from nose.plugins.plugintest import run +from notify_test import NotifyPlugin + +run(suite=unittest.TestSuite(tests=[]),plugins=[NotifyPlugin()]) \ No newline at end of file