Пишу обычный тест (pytest)
import pytest
class TestProject:
@classmethod
def setup_class(cls):
print ('\nClass()')
@classmethod
def teardown_class(cls):
print ('\nClass()')
def test_positive(self):
print ("hello")
assert True
def test_negative(self):
print ("Bye")
assert False
if __name__ == '__main__':
pytest.main('-v -s new_test.py')
В сублиме не возникает никаких вопросов и все проходит нормально, а в PyCharm выдает такую ошибку:
C:\Python34\python.exe "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 3.4.1\helpers\pycharm\utrunner.py" D:\PycharmProjects\Ox_test\test.py::TestProject true
Testing started at 9:04 ...
Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 3.4.1\helpers\pycharm\utrunner.py", line 128, in <module>
all.addTests(testLoader.loadTestsFromTestCase(getattr(module, a[1])))
File "C:\Python34\lib\unittest\loader.py", line 70, in loadTestsFromTestCase
loaded_suite = self.suiteClass(map(testCaseClass, testCaseNames))
File "C:\Python34\lib\unittest\suite.py", line 24, in __init__
self.addTests(tests)
File "C:\Python34\lib\unittest\suite.py", line 60, in addTests
for test in tests:
TypeError: object() takes no parameters
Process finished with exit code 1