test_sample.py
# coding: utf-8
from unittest import TestCase
from nose.tools import eq_
class SampleTest(TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_sample(self):
"""
Testprobe
"""
for i in xrange(3):
yield eq_, True, False
Sogar so
$ nosetests -s -v test_sample.py
Testprobe... ok
----------------------------------------------------------------------
Ran 1 tests in 0.001s
Es hat nicht wie erwartet funktioniert.
Korrigiert wie unten,
test_sample.py
# coding: utf-8
from nose.tools import eq_
def test_sample():
"""
Testprobe
"""
for i in xrange(3):
yield eq_, True, False
Dann
$ nosetests -s -v test_sample.py
Testprobe... FAIL
Testprobe... FAIL
Testprobe... FAIL
======================================================================
FAIL:Testprobe
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/Cellar/numpy/1.9.2/libexec/nose/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
AssertionError: True != False
======================================================================
FAIL:Testprobe
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/Cellar/numpy/1.9.2/libexec/nose/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
AssertionError: True != False
======================================================================
FAIL:Testprobe
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/local/Cellar/numpy/1.9.2/libexec/nose/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
AssertionError: True != False
----------------------------------------------------------------------
Ran 3 tests in 0.011s
FAILED (failures=3)
Es hat wie erwartet funktioniert.
Auf Wiedersehen, Nase. Ich werde zum Pytest gehen ... artigatougozaimashita.
Recommended Posts