-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Rule request
Description
Raise a warning whenever a function named test_xxx also has a pytest.fixture decorator. E.g.
@pytest.fixture()
def test_login():
driver = get_driver()
page = pom.LoginPage(driver)
page.login()
return driver
def test_create_data(test_login):
page = pom.HomePage(test_login)
msg = page.send_data("./data.csv")
assert 'ok' in msgRationale
Functions named test_xxx gets picked up and ran by pytest, but not if they're marked with @pytest.fixture. This could be confusing for new users that have yet to fully internalize the correct concepts.
This was rejected for inclusion into pytest itself as it would be noisy, and considered better suited for a linter. See pytest-dev/pytest#12989 and pytest-dev/pytest#13051
dorschw
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request