Skip to content

Instantly share code, notes, and snippets.

@libbkmz
Created October 29, 2019 15:21
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 libbkmz/cb083f61ebb5aa0db708dde6be41ac0a to your computer and use it in GitHub Desktop.
Save libbkmz/cb083f61ebb5aa0db708dde6be41ac0a to your computer and use it in GitHub Desktop.
from unittest import TestCase
class ManuallyTypedTest(TestCase):
def test_1(self):
self.fail()
def test_2(self):
pass
for i in range(10):
test_name_str = "DynamicVariableTest%s" % i
globals()[test_name_str] = type(
test_name_str,
(TestCase, ),
{
"test_11": lambda self: self.fail(),
"test_22": lambda self: None
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment