Created
September 6, 2017 22:47
-
-
Save lonetwin/6591db44701ab431572448ffc67b7212 to your computer and use it in GitHub Desktop.
Difference in parameterized tests with nose and nose2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# With nose, this test will (incorrectly) pass | |
# With nose2, this test will (correctly) fail | |
import unittest | |
class TestSomething(unittest.TestCase): | |
def validate(self, x, y): | |
self.assertEqual(x, y) | |
def test_many(self): | |
for x, y in [(True, True), (True, False)]: | |
yield self.validate, x, y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment