Skip to content

Commit

Permalink
Fix missing pytest.mark.samples (py-pdf#2407)
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Kitterman committed Jan 15, 2024
1 parent fc893d5 commit 5522d87
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/test_encryption.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ def test_aes_decrypt_corrupted_data():
aes.decrypt(secrets.token_bytes(num))


@pytest.mark.samples()
def test_encrypt_stream_dictionary(pdf_file_path):
user_password = secrets.token_urlsafe(10)

Expand Down
3 changes: 3 additions & 0 deletions tests/test_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,21 @@ def image_similarity(
return 1 - mse


@pytest.mark.samples()
def test_image_similarity_one():
path_a = SAMPLE_ROOT / "018-base64-image/page-0-QuickPDFImd32aa1ab.png"
path_b = path_a
assert image_similarity(path_a, path_b) == 1


@pytest.mark.samples()
def test_image_similarity_zero():
path_a = SAMPLE_ROOT / "018-base64-image/page-0-QuickPDFImd32aa1ab.png"
path_b = SAMPLE_ROOT / "009-pdflatex-geotopo/page-23-Im2.png"
assert image_similarity(path_a, path_b) == 0


@pytest.mark.samples()
def test_image_similarity_mid():
path_a = SAMPLE_ROOT / "018-base64-image/page-0-QuickPDFImd32aa1ab.png"
img_b = Image.open(path_a)
Expand Down
2 changes: 2 additions & 0 deletions tests/test_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ def test_get_images(src, expected_images):
pass


@pytest.mark.samples()
@pytest.mark.parametrize(
("strict", "with_prev_0", "startx_correction", "should_fail", "warning_msgs"),
[
Expand Down Expand Up @@ -675,6 +676,7 @@ def test_reader_properties():
assert reader.is_encrypted is False


@pytest.mark.samples()
@pytest.mark.parametrize(
"strict",
[True, False],
Expand Down
1 change: 1 addition & 0 deletions tests/test_text_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
SAMPLE_ROOT = PROJECT_ROOT / "sample-files"


@pytest.mark.samples()
@pytest.mark.parametrize(("visitor_text"), [None, lambda a, b, c, d, e: None])
def test_multi_language(visitor_text):
reader = PdfReader(RESOURCE_ROOT / "multilang.pdf")
Expand Down

0 comments on commit 5522d87

Please sign in to comment.