Skip to content

Commit

Permalink
Fix function ID not showing up in example (#606)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-Arellano authored May 31, 2024
1 parent 45f15f9 commit 77c0d11
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
19 changes: 15 additions & 4 deletions example_docs/api_example/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,32 @@
:toctree: ../stubs/
Electron
my_function
my_function1
Functions
=========
.. autofunction:: my_function
:noindex:
.. autofunction:: my_function2
"""

from __future__ import annotations

from api_example.electron import Electron


def my_function(input1: str, input2: str, input3: str | None = None, **kwargs) -> int:
def my_function1(input1: str, input2: str, input3: str | None = None, **kwargs) -> int:
"""A function that does awesome stuff.
Returns:
Did the function work.
Raises:
ValueError: If the inputs are not the correct values.
TypeError: If the inputs are not strings.
"""


def my_function2(input1: str, input2: str, input3: str | None = None, **kwargs) -> int:
"""A function that does awesome stuff.
Returns:
Expand Down
2 changes: 1 addition & 1 deletion tests/js/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ test.describe("api docs", () => {
});

test("function page", async ({ page }) => {
await page.goto("stubs/api_example.my_function.html");
await page.goto("stubs/api_example.my_function1.html");
const content = page.locator("div.article-container");
await expect(content).toHaveScreenshot();
});
Expand Down
Binary file modified tests/js/tests.js-snapshots/api-docs-function-page-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/js/tests.js-snapshots/api-docs-module-page-1-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 77c0d11

Please sign in to comment.