wolever / parameterized

Parameterized testing with any Python test framework
Other
833 stars 105 forks source link

`Empty suite` when using `parameterized_class` #171

Closed dinager closed 1 year ago

dinager commented 1 year ago

I am trying to use parameterized_class, I am running the example code added on the repo but I get the tests are not running, I get following log:

/usr/local/bin/python3.9 /Applications/PyCharm.app/Contents/plugins/python/helpers/pycharm/_jb_nosetest_runner.py --target my_test.py::TestMathClassDict
Testing started at 13:10 ...
Launching Nosetest with arguments /Applications/PyCharm.app/Contents/plugins/python/helpers/pycharm/_jb_nosetest_runner.py my_test.py:TestMathClassDict in /path/to/my_repo

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK

Process finished with exit code 0

Empty suite

here is the code

from nose.tools import assert_equal
from parameterized import parameterized_class

import unittest

@parameterized_class([
   { "a": 3, "expected": 2 },
   { "b": 5, "expected": -4 },
])
class TestMathClassDict(unittest.TestCase):
   a = 1
   b = 1

   def test_subtract(self):
      assert_equal(self.a - self.b, self.expected)

python version: 3.7.16

dinager commented 1 year ago

solved by using pytest in pycharm runner, like this instead of pycharm using the _jb_nosetest_runner it uses the _jb_pytest_runner

arun-thekkuden commented 7 months ago

@dinager I don't see it working even with _jb_pytest_runner Did you change any other settings?