Jun-01-2020, 05:05 PM
Nice, but I decided to solve it in the following way:
import os import pytest WORKING_DIR = None @pytest.fixture def working_dir(autouse=True, scope='function'): global WORKING_DIR if not WORKING_DIR: WORKING_DIR = os.getcwd() os.chdir(WORKING_DIR) return WORKING_DIR