Skip to content

Commit

Permalink
Add test for auto-module and remove needtable support.
Browse files Browse the repository at this point in the history
- This also update the test to the latest version of the dependencies.

Signed-off-by: Liran Funaro <[email protected]>
  • Loading branch information
liran-funaro committed Aug 26, 2024
1 parent 4d29411 commit 96b74be
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ celerybeat-schedule
.env
.venv
env
venv/
venv*/
ENV/
env.bak/
venv.bak/
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ test-diff:

@# Copy just one file for verification
@cp "$(BUILD_DIR)/overrides/markdown/auto-summery.md" "$(BUILD_DIR)/markdown/overrides-auto-summery.md"
@rm -r $(BUILD_DIR)/markdown/_static $(BUILD_DIR)/markdown/permalink.html

@echo "Verifies outputs..."
@diff --recursive --color=always --side-by-side --text --suppress-common-lines \
Expand Down
54 changes: 54 additions & 0 deletions tests/expected/auto-module.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Auto Module

Example module

### *class* Point(x, y)

A Point

## Attributes

x: int
: The x value

y: str
: The y value

#### x *: [int](https://docs.python.org/3/library/functions.html#int)*

X value

#### y *: [str](https://docs.python.org/3/library/stdtypes.html#str)*

Y value

* **Parameters:**
* **x** ([*int*](https://docs.python.org/3/library/functions.html#int))
* **y** ([*str*](https://docs.python.org/3/library/stdtypes.html#str))

### deprecated_function()

Some old function.

#### Deprecated
Deprecated since version 3.1: Use `other()` instead.

### func1(param1)

This is a function with a single parameter.
Thanks to github.com/remiconnesson.

* **Parameters:**
**param1** ([*int*](https://docs.python.org/3/library/functions.html#int)) – This is a single parameter.
* **Return type:**
[int](https://docs.python.org/3/library/functions.html#int)

### func2(param1, param2)

This is a function with two parameters.

* **Parameters:**
* **param1** ([*int*](https://docs.python.org/3/library/functions.html#int)) – This is the first parameter.
* **param2** ([*int*](https://docs.python.org/3/library/functions.html#int)) – This is the second parameter.
* **Return type:**
[str](https://docs.python.org/3/library/stdtypes.html#str)
2 changes: 1 addition & 1 deletion tests/expected/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
* [Http domain directive](blocks.md#http-domain-directive)
* [Test Image With Target](image-target.md)
* [Empty package](empty.md)
* [Need Table](needtable.md)
* [Glossary test for multiple glossaries](glossaries.md)
* [Section for first glossary](glossaries.md#section-for-first-glossary)
* [Section for second glossary](glossaries.md#section-for-second-glossary)
* [Section for third glossary](glossaries.md#section-for-third-glossary)
* [Auto Module](auto-module.md)
14 changes: 9 additions & 5 deletions tests/expected/library/my_module.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ Example module

### Sub Modules

| [`my_module.module_class`](my_module.module_class.md#module-my_module.module_class) | A module class file. |
|---------------------------------------------------------------------------------------|------------------------|
| [`my_module.submodule`](my_module.submodule.md#module-my_module.submodule) | Example sub-module |
| [`module_class`](my_module.module_class.md#module-my_module.module_class) | A module class file. |
|-----------------------------------------------------------------------------|------------------------|
| [`submodule`](my_module.submodule.md#module-my_module.submodule) | Example sub-module |

### Classes and Functions

Expand All @@ -31,8 +31,8 @@ X value
Y value

* **Parameters:**
* **x** ([*int*](https://docs.python.org/3/library/functions.html#int))
* **y** ([*str*](https://docs.python.org/3/library/stdtypes.html#str))
* **x** ([*int*](https://docs.python.org/3/library/functions.html#int))
* **y** ([*str*](https://docs.python.org/3/library/stdtypes.html#str))

### deprecated_function()

Expand All @@ -48,6 +48,8 @@ Thanks to github.com/remiconnesson.

* **Parameters:**
**param1** ([*int*](https://docs.python.org/3/library/functions.html#int)) – This is a single parameter.
* **Return type:**
[int](https://docs.python.org/3/library/functions.html#int)

### func2(param1, param2)

Expand All @@ -56,3 +58,5 @@ This is a function with two parameters.
* **Parameters:**
* **param1** ([*int*](https://docs.python.org/3/library/functions.html#int)) – This is the first parameter.
* **param2** ([*int*](https://docs.python.org/3/library/functions.html#int)) – This is the second parameter.
* **Return type:**
[str](https://docs.python.org/3/library/stdtypes.html#str)
4 changes: 2 additions & 2 deletions tests/expected/library/my_module.submodule.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Example sub-module

### Sub Modules

| [`my_module.submodule.my_class`](my_module.submodule.my_class.md#module-my_module.submodule.my_class) | A submodule class file. |
|---------------------------------------------------------------------------------------------------------|---------------------------|
| [`my_class`](my_module.submodule.my_class.md#module-my_module.submodule.my_class) | A submodule class file. |
|-------------------------------------------------------------------------------------|---------------------------|

### Classes and Functions
10 changes: 0 additions & 10 deletions tests/expected/needtable.md

This file was deleted.

4 changes: 2 additions & 2 deletions tests/my_module/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def deprecated_function():
pass


def func1(param1: int):
def func1(param1: int) -> int:
"""This is a function with a single parameter.
Thanks to github.com/remiconnesson.
Expand All @@ -41,7 +41,7 @@ def func1(param1: int):
pass


def func2(param1: int, param2: int):
def func2(param1: int, param2: int) -> str:
"""This is a function with two parameters.
:param param1: This is the first parameter.
Expand Down
5 changes: 5 additions & 0 deletions tests/source/auto-module.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Auto Module
-------------
.. automodule:: my_module
:members:
:no-index:
1 change: 0 additions & 1 deletion tests/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"sphinx.ext.autosummary", # Create neat summary tables
"sphinx.ext.intersphinx", # Link to other project's documentation (see mapping below)
"sphinx_markdown_builder",
"sphinx_needs",
"sphinxcontrib.httpdomain",
]

Expand Down
2 changes: 1 addition & 1 deletion tests/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ Main Test File
blocks.rst
image-target.rst
empty.rst
needtable.rst
glossaries.rst
auto-module.rst
6 changes: 0 additions & 6 deletions tests/source/needtable.rst

This file was deleted.

0 comments on commit 96b74be

Please sign in to comment.