I'm trying to run tests on a Django app using selenium + pytest which according to the docs, below should work.
import pytest
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from selenium.webdriver import Chrome
class TestViews(StaticLiveServerTestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.driver = Chrome()
@classmethod
def tearDownClass(cls):
if hasattr(cls, 'driver'):
cls.driver.quit()
super().tearDownClass()
@pytest.mark.parametrize('param', ['param1', 'param2'])
def test_fails(self, param):
pass
However, I get:
Creating test database for alias 'default'...
Found 1 test(s).
System check identified no issues (0 silenced).
Error
TypeError: TestViews.test_fails() missing 1 required positional argument: 'param'
Destroying test database for alias 'default'...