コード例 #1
0
ファイル: test_icecream.py プロジェクト: gruns/icecream
    def testDifferentName(self):
        from icecream import ic as foo
        with disableColoring(), captureStandardStreams() as (out, err):
            foo()
        assert lineIsContextAndTime(err.getvalue())

        newname = foo
        with disableColoring(), captureStandardStreams() as (out, err):
            newname(a)
        pair = parseOutputIntoPairs(out, err, 1)[0][0]
        assert pair == ('a', '1')
コード例 #2
0
ファイル: test_icecream.py プロジェクト: mariku/icecream
    def testDifferentName(self):
        from icecream import ic as foo
        with captureStandardStreams() as (out, err):
            foo()
        pair = parseOutputIntoPairs(out, err, 1)[0][0]
        assert pairIsNoArgumentsOutput(pair)

        newname = foo
        with captureStandardStreams() as (out, err):
            newname(1)
        pair = parseOutputIntoPairs(out, err, 1)[0][0]
        assert pair == ('1', '1')