示例#1
0
    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))
示例#2
0
文件: test_base.py 项目: esc/PyMVPA
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,))
示例#3
0
    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,))
示例#4
0
文件: __init__.py 项目: arokem/PyMVPA
    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
示例#5
0
    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