CleanCut / green

Green is a clean, colorful, fast python test runner.
MIT License
793 stars 75 forks source link

dont support unittest.skipIf #144

Closed EtheriousNatsu closed 7 years ago

EtheriousNatsu commented 7 years ago

version: 2.7.2 os : mac

code;

from __future__ import unicode_literals
import sys
import unittest

class TestStates(unittest.TestCase):

    def test0Pass(self):
        """
        This test will print output to stdout, and then pass.
        """
        print("Sunshine and daisies")

    @unittest.skipIf(True, "I am skipIf++")
    def test1Fail(self):
        """
        This test will print output to stderr, and then fail an assertion.
        """
        sys.stderr.write("Doom and gloom.\n")
        self.assertTrue(False)

    @unittest.skipUnless(False,"I am skipUnless")
    def test2Error(self):
        """
        An Exception will be raised (and not caught) while running this test.
        """
        raise Exception

    @unittest.skip("This is the 'reason' portion of the skipped test.")
    def test3Skip(self):
        """
        This test will be skipped.
        """
        pass

    @unittest.expectedFailure
    def test4ExpectedFailure(self):
        """
        This test will fail, but we expect it to.
        """
        self.assertEqual(True, False)

    @unittest.expectedFailure
    def test5UnexpectedPass(self):
        """
        This test will pass, but we expected it to fail!
        """
        pass

when i run this code in pycharm, the result like thsi:

image

but when i run this code in green:

image

I think this is a bug

CleanCut commented 7 years ago

What do you think is a bug?

CleanCut commented 7 years ago

I'm sorry, but it works fine for me on my Mac using Python 2.7.12, Python 3.5.2, or PyPy 5.6.

I can't reproduce your problem. Perhaps it is because you are using Python 2.7.2 (which is very old). Have you tried updating to macOS Sierra?

screen shot 2017-02-14 at 5 01 37 pm

EtheriousNatsu commented 7 years ago

i am sorry, i will try right now