Skip to content

Commit 6f9791d

Browse files
committed
Test fixes
1 parent eb711a3 commit 6f9791d

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

tests/conftest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -470,16 +470,16 @@ def text_path_with_unicode_new_lines(tmp_path_factory):
470470

471471

472472
@pytest.fixture(scope="session")
473-
def image_path():
473+
def image_file():
474474
return os.path.join(os.path.dirname(__file__), "features", "data", "test_image_rgb.jpg")
475475

476476

477477
@pytest.fixture(scope="session")
478-
def zip_image_path(image_path, tmp_path_factory):
478+
def zip_image_path(image_file, tmp_path_factory):
479479
import zipfile
480480

481481
path = tmp_path_factory.mktemp("data") / "dataset.img.zip"
482482
with zipfile.ZipFile(path, "w") as f:
483-
f.write(image_path, arcname=os.path.basename(image_path))
484-
f.write(image_path, arcname=os.path.basename(image_path).replace(".jpg", "2.jpg"))
483+
f.write(image_file, arcname=os.path.basename(image_file))
484+
f.write(image_file, arcname=os.path.basename(image_file).replace(".jpg", "2.jpg"))
485485
return path

tests/packaged_modules/test_csv.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ def malformed_csv_file(tmp_path):
4141

4242

4343
@pytest.fixture
44-
def csv_file_with_image(tmp_path, image_path):
44+
def csv_file_with_image(tmp_path, image_file):
4545
filename = tmp_path / "csv_with_image.csv"
4646
data = textwrap.dedent(
4747
f"""\
4848
image
49-
{image_path}
49+
{image_file}
5050
"""
5151
)
5252
with open(filename, "w") as f:

tests/packaged_modules/test_imagefolder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ def cache_dir(tmp_path):
1818

1919

2020
@pytest.fixture
21-
def image_file_with_metadata(tmp_path, image_path):
21+
def image_file_with_metadata(tmp_path, image_file):
2222
image_filename = tmp_path / "image_rgb.jpg"
23-
shutil.copyfile(image_path, image_filename)
23+
shutil.copyfile(image_file, image_filename)
2424
image_metadata_filename = tmp_path / "metadata.jsonl"
2525
image_metadata = textwrap.dedent(
2626
"""\

tests/packaged_modules/test_text.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ def text_file(tmp_path):
2626

2727

2828
@pytest.fixture
29-
def text_file_with_image(tmp_path, image_path):
29+
def text_file_with_image(tmp_path, image_file):
3030
filename = tmp_path / "text_with_image.txt"
3131
with open(filename, "w", encoding="utf-8") as f:
32-
f.write(image_path)
32+
f.write(image_file)
3333
return str(filename)
3434

3535

0 commit comments

Comments
 (0)