Skip to content

MAINT Move figure_rst path testing to own unit test#1173

Merged
larsoner merged 4 commits intosphinx-gallery:masterfrom
lucyleeow:tst_img
Aug 18, 2023
Merged

MAINT Move figure_rst path testing to own unit test#1173
larsoner merged 4 commits intosphinx-gallery:masterfrom
lucyleeow:tst_img

Conversation

@lucyleeow
Copy link
Copy Markdown
Contributor

Test one thing in test_figure_rst. Remove path testing to separate test.

# test issue #229
local_img = [os.path.join(os.getcwd(), "third." + ext)]

def test_figure_rst_path():
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we still want this, right?

Suggested change
def test_figure_rst_path():
@pytest.mark.parametrize("ext", _KNOWN_IMG_EXTS)
def test_figure_rst_path():

local_img = [os.path.join(os.getcwd(), "third.png")]
image_rst = figure_rst(local_img, ".")

single_image = SG_IMAGE % ("third." + ext, "", "/third." + ext)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... then you'll need to revert this

@lucyleeow
Copy link
Copy Markdown
Contributor Author

AFAICT #229 and the fix 69f11a1 was just due to forgetting to replace / with os.sep, so I don't think extensions make a difference? Happy to revert if not though.

@larsoner larsoner enabled auto-merge (squash) August 18, 2023 11:45
@larsoner larsoner disabled auto-merge August 18, 2023 11:45
@larsoner larsoner enabled auto-merge (squash) August 18, 2023 11:45
@larsoner larsoner merged commit bdee85c into sphinx-gallery:master Aug 18, 2023
@lucyleeow lucyleeow deleted the tst_img branch August 18, 2023 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants