Skip to content

Commit 7c77366

Browse files
docs: Add reference docs for tap & target testing helpers (#2219)
1 parent 2f597fe commit 7c77366

File tree

5 files changed

+26
-10
lines changed

5 files changed

+26
-10
lines changed

docs/classes/singer_sdk.authenticators.APIAuthenticatorBase.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55

66
.. autoclass:: APIAuthenticatorBase
77
:members:
8-
:special-members: __init__, __call__
8+
:special-members: __init__, __call__

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
5757

5858
# Show typehints in the description, along with parameter descriptions
59-
autodoc_typehints = "signature"
59+
autodoc_typehints = "description"
6060
autodoc_class_signature = "separated"
6161
autodoc_member_order = "groupwise"
6262

docs/testing.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The Meltano SDK test framework consists of 4 main components:
1010
1. A runner class (`TapTestRunner` and `TargetTestRunner`), responsible for executing Taps/Targets and capturing their output.
1111
1. A suite dataclass, containing a list of tests.
1212
1. A test template classes (`TapTestTemplate`, `StreamTestTemplate`, `AttributeTestTemplate` and `TargetTestTemplate`), with methods to `.setup()`, `.test()`, `.validate()` and `.teardown()` (called in that order using `.run()`).
13-
1. `get_tap_test_class` and `get_target_test_class` factory methods. These wrap a `get_test_class` factory method, which takes a runner and a list of suites and return a `pytest` test class.
13+
1. {func}`get_tap_test_class <singer_sdk.testing.get_tap_test_class>` and {func}`get_target_test_class <singer_sdk.testing.get_target_test_class>` factory methods. These wrap a `get_test_class` factory method, which takes a runner and a list of suites and return a `pytest` test class.
1414

1515
## Example Usage
1616

@@ -76,7 +76,7 @@ class TestTargetExample(StandardTargetTests):
7676

7777
## Configuring Tests
7878

79-
Test suite behaviors can be configured by passing a `SuiteConfig` instance to the `get_test_class` functions:
79+
Test suite behaviors can be configured by passing a {func}`SuiteConfig <singer_sdk.testing.SuiteConfig>` instance to the `get_test_class` functions:
8080

8181
```python
8282
from singer_sdk.testing import SuiteConfig, get_tap_test_class
@@ -101,7 +101,7 @@ TestTapStackExchange = get_tap_test_class(
101101
)
102102
```
103103

104-
Check out [`singer_sdk/testing/config.py`](https://github.com/meltano/sdk/tree/main/singer_sdk/testing/config.py) for available config options.
104+
Check out [the reference](#reference) for more information on the available configuration options.
105105

106106
## Writing New Tests
107107

@@ -127,6 +127,21 @@ my_custom_tap_tests = TestSuite(
127127
)
128128
```
129129

130-
This suite can now be passed to `get_tap_test_class` or `get_target_test_class` in a list of `custom_suites` along with any other suites, to generate your custom test class.
130+
This suite can now be passed to {func}`get_tap_test_class <singer_sdk.testing.get_tap_test_class>` or {func}`get_target_test_class <singer_sdk.testing.get_target_test_class>` in a list of `custom_suites` along with any other suites, to generate your custom test class.
131131

132132
If your new test covers a common or general case, consider contributing to the standard test library via a pull request to [meltano/sdk](https://github.com/meltano/sdk).
133+
134+
## Reference
135+
136+
```{eval-rst}
137+
.. autofunction:: singer_sdk.testing.get_tap_test_class
138+
```
139+
140+
```{eval-rst}
141+
.. autofunction:: singer_sdk.testing.get_target_test_class
142+
```
143+
144+
```{eval-rst}
145+
.. autoclass:: singer_sdk.testing.SuiteConfig
146+
:members:
147+
```

poetry.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,11 @@ faker = {version = "~=22.5", optional = true}
9595

9696
[tool.poetry.extras]
9797
docs = [
98-
"sphinx",
9998
"furo",
100-
"sphinx-copybutton",
10199
"myst-parser",
100+
"pytest",
101+
"sphinx",
102+
"sphinx-copybutton",
102103
"sphinx-autobuild",
103104
"sphinx-inline-tabs",
104105
"sphinx-notfound-page",

0 commit comments

Comments
 (0)