def testWtf(self): """Very basic testing -- just to see if it doesn't crash""" try: wtf() except Exception, e: self.fail('Testing of systemInfo failed with "%s"' % str(e))
def test_wtf(filename): """Very basic testing -- just to see if it doesn't crash""" sinfo = str(wtf()) sinfo_excludes = str(wtf(exclude=["process"])) ok_(len(sinfo) > len(sinfo_excludes)) ok_(not "Process Info" in sinfo_excludes) # check if we could store and load it back wtf(filename) try: sinfo_from_file = "\n".join(open(filename, "r").readlines()) except Exception, e: raise AssertionError("Testing of loading from a stored a file has failed: %r" % (e,))
def test_wtf(self): """Very basic testing -- just to see if it doesn't crash""" sinfo = str(wtf()) sinfo_excludes = str(wtf(exclude=['process'])) self.failUnless(len(sinfo) > len(sinfo_excludes)) self.failUnless(not 'Process Info' in sinfo_excludes) # check if we could store and load it back filename = mktemp('mvpa', 'test') wtf(filename) try: sinfo_from_file = '\n'.join(open(filename, 'r').readlines()) except Exception, e: self.fail('Testing of loading from a stored a file has failed: %r' % (e,))
def _pymvpa_excepthook(*args): """Custom exception handler to report also pymvpa's wtf Calls original handler, and then collects WTF and spits it out """ ret = _sys_excepthook(*args) sys.stdout.write("PyMVPA's WTF: collecting information... hold on...") sys.stdout.flush() wtfs = wtf() sys.stdout.write("\rPyMVPA's WTF: \n") sys.stdout.write(str(wtfs)) return ret
def _pymvpa_excepthook(*args): """Custom exception handler to report also pymvpa's wtf Calls original handler, and then collects WTF and spits it out """ ret = _sys_excepthook(*args) sys.stdout.write("PyMVPA's WTF: collecting information... hold on...") sys.stdout.flush() wtfs = wtf() sys.stdout.write( "\rPyMVPA's WTF: \n") sys.stdout.write(str(wtfs)) return ret