I am writing several tests using pytest, many of which have similar lights. I want to put these "global" lights in a single file so that they can be reused in several test files. My first thought was to create a file fixtures.pysuch as
import pytest
@pytest.fixture()
def my_fixture():
Now, how can I use this device in my_tests.py?
def test_connect(my_fixture):
pass
It gives fixture 'my_fixture' not found. I can from fixtures import my_fixture. What is the proposed solution to this situation?
source
share