Skip to content

Instantly share code, notes, and snippets.

@lonetwin
Created September 6, 2017 22:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lonetwin/6591db44701ab431572448ffc67b7212 to your computer and use it in GitHub Desktop.
Save lonetwin/6591db44701ab431572448ffc67b7212 to your computer and use it in GitHub Desktop.
Difference in parameterized tests with nose and nose2
#!/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