How to indicate that a test has not yet been written in Python?

I am doing TDD using Python and a module unittest. In NUnit you can Assert.Inconclusive("This test hasn't been written yet").

So far, I have not been able to find anything similar in Python to indicate that "these tests are just placeholders, I need to go back and actually put the code in them."

Is there a Pythonic pattern for this?

+5
source share
3 answers

With the new updated unittest module, you can skip tests:

@skip("skip this test")
def testSomething(self):
    pass # TODO

def testBar(self):
    self.skipTest('We need a test here, really')

def testFoo(self):
    raise SkipTest('TODO: Write a test here too')

When the test runner starts them, they are counted separately ("skipped: (n)").

+11
source

I would not let them pass or show OK, because you will not find them easily back.

, ( ), , , .

+4

self.fail todo

def test_some_edge_case(self):
    self.fail('Need to check for wibbles')

, tdd.

+2
source

All Articles