nose-parameterized

PyCharm errors for valid python code

孤街浪徒 提交于 2019-12-13 08:03:11
问题 I posted the following question regarding nose and parameterized tests: use-class-method-in-nose-parameterize.expand call and I got my answer, but now I wonder why PyCharm is failing to recognize this as valid code. Does anyone know how to turn off this warning in Pycharm, or should i submit this as a bug to jet brains? Here is what I know works, but PyCharm provides false negative error messages: class MyUnitTestClass(TestCase): def generate_scenarios(): yield ('this_is_my_test', 1, 2)

use class method in nose parameterize.expand call

吃可爱长大的小学妹 提交于 2019-12-11 10:48:17
问题 I have a generator method that is building a large set of test criteria, I know i can make a non class method to be called, but I much rather have the parameter building method be part of my test class. is there a way to do this? here is a simple description of what I want to do: class MyUnitTestClass(TestCase): @staticmethod def generate_scenarios(): yield ('this_is_my_test', 1, 2) @parameterized.expand(generate_scenarios()) def test_scenario(self, test_name, input, expected_output) self