Skip to content

Commit

Permalink
Fix use of FakeRepository in tests that change current dir (jazzband#…
Browse files Browse the repository at this point in the history
…1517)

outside of the repo root, e.g. via tmpdir_cwd,
or when running any test from a different working dir.
  • Loading branch information
richafrank committed Oct 27, 2021
1 parent eb9162f commit dc80b95
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@
make_install_requirement,
)

from .constants import MINIMAL_WHEELS_PATH
from .constants import MINIMAL_WHEELS_PATH, TEST_DATA_PATH
from .utils import looks_like_ci


class FakeRepository(BaseRepository):
def __init__(self):
with open("tests/test_data/fake-index.json") as f:
with open(os.path.join(TEST_DATA_PATH, "fake-index.json")) as f:
self.index = json.load(f)

with open("tests/test_data/fake-editables.json") as f:
with open(os.path.join(TEST_DATA_PATH, "fake-editables.json")) as f:
self.editables = json.load(f)

def get_hashes(self, ireq):
Expand Down

0 comments on commit dc80b95

Please sign in to comment.