purple-hydrogen-4740
05/22/2023, 6:18 PMbitter-ability-32190
05/22/2023, 6:21 PMBUILD.pants
files to instruct Pants what should also be in the sandbox.
Usually though, that's brittle so you either:
1. Need to find out how to convince Pants to find those dependencies automatically
2. Have to change the paths/code so that 1. happens
If you share a little more explicitly how pytest is configured to load fixtures from that path, we might be able to avoid 2 with existing facilities.purple-hydrogen-4740
05/22/2023, 6:25 PM# conftest.py
DIR_PATH = os.path.dirname(os.path.realpath(__file__))
@pytest.fixture
def data():
with open(f"{DIR_PATH}/../../fixtures/fixture.json", "r") as fh:
return json.load(fh)
bitter-ability-32190
05/22/2023, 6:28 PM"<path/to/>fixtures/fixture.json"
where the <path/to>
part is the parts between the build root and that directorybitter-ability-32190
05/22/2023, 6:29 PMfile
target for the fixtures. files(sounrce=["*.json"])
(or whatever makes most sense) in BUILD
in the fixtures
dir should do itbitter-ability-32190
05/22/2023, 6:30 PMpants dependencies <path/to/conftest.py>
lists the correct file dependenciespurple-hydrogen-4740
05/22/2023, 6:35 PM