How do pytest fixtures work?
Fixtures are used to supply data into the tests, such as database connections, test URLs, and input data. As a result, rather than repeating the same code for each test, we can attach a fixture function to the tests, which will run and return data to the test before each test is executed. Pytest - Fixtures.