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(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(filename): """Very basic testing of wtf()""" sinfo = str(wtf()) sinfo_excludes = str(wtf(exclude=['runtime'])) ok_(len(sinfo) > len(sinfo_excludes), msg="Got not less info when excluded runtime." " Original one was:\n%s and without process:\n%s" % (sinfo, sinfo_excludes)) ok_(not 'RUNTIME' 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 as e: raise AssertionError( 'Testing of loading from a stored a file has failed: %r' % (e, ))
def test_wtf(filename): """Very basic testing of wtf()""" sinfo = str(wtf()) sinfo_excludes = str(wtf(exclude=['runtime'])) ok_(len(sinfo) > len(sinfo_excludes), msg="Got not less info when excluded runtime." " Original one was:\n%s and without process:\n%s" % (sinfo, sinfo_excludes)) ok_(not 'RUNTIME' 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 _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