Skip to content

Commit 30c4619

Browse files
committed
docs: say which dialects, shapes and zones are read
1 parent 26d08c5 commit 30c4619

7 files changed

Lines changed: 75 additions & 4 deletions

File tree

‎docs/extending/integrations.md‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ renders them as a collapsible tree and downstream tooling can parse them.
5454
Anything JSON cannot express degrades to a marked fallback instead of failing the attachment:
5555

5656
- `{"__repr__": "..."}` for arbitrary objects, datetimes, non-finite floats, and circular references
57-
- `{"__type__": "set", "__data__": [...]}` for sets.
57+
- `{"__type__": "set", "__data__": [...]}` for sets
58+
- `{"__type__": "dict", "__data__": [[key, value], ...]}` for a mapping with any non-string key, since a
59+
JSON object has string keys only and rendering `1` as `"1"` drops whichever of the two came second.
5860

5961
Oversized values are capped: strings at 4000 chars, containers at 100 items.
6062

@@ -271,7 +273,9 @@ On failure the library's own detailed diff is carried in the assertion message.
271273

272274
Two array assertions, both accepting any array-like numpy can coerce:
273275

274-
- `is_array_equal()` - exact, via `numpy.testing.assert_array_equal`
276+
- `is_array_equal()` - exact, via `numpy.testing.assert_array_equal`, with the shapes compared first, so a
277+
scalar is not broadcast over an array (pass `strict=False` to let numpy broadcast, or `strict=True` to
278+
compare dtypes too)
275279
- `is_array_close_to()` - float-tolerant, via `numpy.testing.assert_allclose`, for comparing computed
276280
arrays.
277281

‎docs/guides/assertions.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,9 @@ assert_that(naive).is_before(aware) # TypeError
653653
assert_that(naive).is_equal_to_ignoring_seconds(aware) # TypeError
654654
```
655655

656-
Make both aware or both naive first, then the comparison is well defined.
656+
Make both aware or both naive first, then the comparison is well defined. Two aware values need not share
657+
a zone: the `ignoring_*` assertions read the expected side on the subject's clock before comparing, so
658+
`12:00Z` and `17:00+05:00` are the same instant to the second, and `12:00+05:00` is not.
657659

658660
Equality can ignore units of time, and the numeric comparisons work on dates too:
659661

‎docs/guides/data.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,13 @@ the other assertion libraries here offer.
8484

8585
Three spec dialects are read:
8686

87-
- **OpenAPI 3.1**, as written
87+
- **OpenAPI 3.1 and 3.2**, as written: both carry JSON Schema 2020-12
8888
- **OpenAPI 3.0**, including its `nullable` keyword
8989
- **Swagger 2.0**, where the schema sits directly on the response, including its `x-nullable` extension
9090

91+
A spec declaring any other `openapi` version is refused. Read as one of these it would validate against
92+
the wrong dialect, which passes every keyword that dialect cannot spell.
93+
9194
Inside any of them, `$ref`, `oneOf` / `allOf` / `anyOf`, `enum` and `format` validate with full
9295
JSON-Schema semantics.
9396

‎docs/reference/async.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,13 @@ callable value, chain the assertion you expect to eventually hold, and await the
1818
show_root_toc_entry: true
1919

2020
::: assertpy2.async_assertions.AsyncAssertionBuilder
21+
options:
22+
show_root_heading: true
23+
show_root_full_path: false
24+
show_root_toc_entry: true
2125

2226
::: assertpy2.async_assertions.SyncAssertionBuilder
27+
options:
28+
show_root_heading: true
29+
show_root_full_path: false
30+
show_root_toc_entry: true

‎docs/reference/entry-points.md‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ drives editor autocomplete.
2929
show_root_full_path: false
3030
show_root_toc_entry: true
3131

32+
::: assertpy2.assertpy.NegatedBuilder
33+
options:
34+
show_root_heading: true
35+
show_root_full_path: false
36+
show_root_toc_entry: true
37+
3238
::: assertpy2.outcome.AssertionOutcome
3339
options:
3440
show_root_heading: true
@@ -51,11 +57,23 @@ drives editor autocomplete.
5157
show_root_heading: true
5258
show_root_toc_entry: true
5359

60+
::: assertpy2.assertpy.WarningLoggingAdapter
61+
options:
62+
show_root_heading: true
63+
show_root_full_path: false
64+
show_root_toc_entry: true
65+
5466
::: assertpy2.assertpy.soft_assertions
5567
options:
5668
show_root_heading: true
5769
show_root_toc_entry: true
5870

71+
::: assertpy2.assertpy.SoftAssertionCollector
72+
options:
73+
show_root_heading: true
74+
show_root_full_path: false
75+
show_root_toc_entry: true
76+
5977
::: assertpy2.assertpy.assert_all
6078
options:
6179
show_root_heading: true

‎docs/reference/errors.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,15 @@ working unchanged. See [Errors & reporting](../guides/errors.md) for usage.
4040
show_root_heading: true
4141
show_root_full_path: false
4242
show_root_toc_entry: true
43+
44+
::: assertpy2.errors.DanglingAssertionWarning
45+
options:
46+
show_root_heading: true
47+
show_root_full_path: false
48+
show_root_toc_entry: true
49+
50+
::: assertpy2.errors.VacuousAssertionWarning
51+
options:
52+
show_root_heading: true
53+
show_root_full_path: false
54+
show_root_toc_entry: true

‎docs/reference/matchers.md‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,27 @@ and ``~``. See the [Matchers guide](../guides/matchers.md) for usage, compositio
1919
show_root_heading: true
2020
show_root_full_path: false
2121
show_root_toc_entry: true
22+
23+
::: assertpy2.matchers.Matcher
24+
options:
25+
show_root_heading: true
26+
show_root_full_path: false
27+
show_root_toc_entry: true
28+
29+
::: assertpy2.matchers.register_matcher
30+
options:
31+
show_root_heading: true
32+
show_root_full_path: false
33+
show_root_toc_entry: true
34+
35+
::: assertpy2.matchers.unregister_matcher
36+
options:
37+
show_root_heading: true
38+
show_root_full_path: false
39+
show_root_toc_entry: true
40+
41+
::: assertpy2.matchers.clear_custom_matchers
42+
options:
43+
show_root_heading: true
44+
show_root_full_path: false
45+
show_root_toc_entry: true

0 commit comments

Comments
 (0)