コード例 #1
0
def test_deprecated_string_exception():
    w = warning_trapper()
    try:
        raise 'Error'
    except:
        pass
    m = w.finish()
    try:
        raise 'foo'
    except TypeError as e:
        print(e.message)
コード例 #2
0
def test_deprecated_string_exception():
    w = warning_trapper()
    try:
        raise 'Error'
    except:
        pass
    m = w.finish()
    try:
        raise 'foo'
    except TypeError, e:
        print e.message
コード例 #3
0
ファイル: gc_test.py プロジェクト: calbonaler/DLR_Japanese
def test_disable():
    if is_cli or is_silverlight:
        from iptest.warning_util import warning_trapper
        w = warning_trapper()
        w.hook()
        gc.disable()
        m = w.finish()        
        AreEqual(m[0].message, 'IronPython has no support for disabling the GC')
    else:
        gc.disable()
        result = gc.isenabled()
        Assert(result == False,"enable Method can't set gc.isenabled as false.")
コード例 #4
0
ファイル: gc_test.py プロジェクト: dearman/iron-python
def test_disable():
    if is_cli or is_silverlight:
        from iptest.warning_util import warning_trapper
        w = warning_trapper()
        w.hook()
        gc.disable()
        m = w.finish()        
        AreEqual(m[0].message, 'IronPython has no support for disabling the GC')
    else:
        gc.disable()
        result = gc.isenabled()
        Assert(result == False,"enable Method can't set gc.isenabled as false.")