Skip to content

Commit aa36de1

Browse files
committed
Use mkdocstrings
1 parent 348b53c commit aa36de1

File tree

2 files changed

+4
-125
lines changed

2 files changed

+4
-125
lines changed

docs/api_reference.md

+1-124
Original file line numberDiff line numberDiff line change
@@ -1,124 +1 @@
1-
`unittest_extensions.TestCase` extends `unittest.TestCase` with the below methods.
2-
3-
**assertResult(self, value)**
4-
Fail if the result is unequal to the value as determined by the '==' operator.
5-
Equivalent to `assertEqual(self.result(), value)`.
6-
7-
**assertResultAlmost(self, value, places=None, delta=None)**
8-
Fail if the result is unequal to the value as determined by their difference rounded
9-
to the given number of decimal places (default 7) and comparing to zero, or by
10-
comparing that the difference between the two objects is more than the given delta.
11-
Equivalent to `assertAlmostEqual(self.result(), value, places, delta=delta)`.
12-
13-
**assertResultCount(self, iterable)**
14-
Assert that the result has the same elements as the iterable without regard to order.
15-
Equivalent to `assertCountEqual(self.result(), iterable)`.
16-
17-
**assertResultDict(self, dct)**
18-
Assert that the result is equal to dct.
19-
Equivalent to `assertDictEqual(self.result(), dct)`.
20-
21-
**assertResultFalse(self)**
22-
Check that the result is false.
23-
Equivalent to `assertFalse(self.result())`.
24-
25-
**assertResultGreater(self, value)**
26-
Just like self.assertTrue(self.result() > value), but with a nicer default message.
27-
Equivalent to `assertGreater(self, result(), value)`.
28-
29-
**assertResultGreaterEqual(self, value)**
30-
Just like self.assertTrue(self.result() >= value), but with a nicer default message.
31-
Equivalent to `assertGreaterEqual(self.result(), value)`.
32-
33-
**assertResultIn(self, container)**
34-
Just like self.assertTrue(self.result() in container), but with a nicer default message.
35-
Equivalent to `assertIn(self.result(), container)`.
36-
37-
**assertResultIs(self, value)**
38-
Just like self.assertTrue(self.result() is value), but with a nicer default message.
39-
Equivalent to `assertIs(self.result(), value)`.
40-
41-
**assertResultIsInstance(self, cls)**
42-
Just like self.assertTrue(self.result() in container), but with a nicer default message.
43-
Equivalent to `assertIsInstance(self.result(), cls)`.
44-
45-
**assertResultIsNot(self, value)**
46-
Just like self.assertTrue(self.result() is not value), but with a nicer default message.
47-
Equivalent to `assertIsNot(self.result(), value)`.
48-
49-
**assertResultIsNotInstance(self, cls)**
50-
Just like self.assertTrue(self.result() not in container), but with a nicer default message.
51-
Equivalent to `assertNotIsInstance(self.result(), cls)`.
52-
53-
**assertResultLess(self, value)**
54-
Just like self.assertTrue(self.result() < value), but with a nicer default message.
55-
Equivalent to `assertLess(self.result(), value)`.
56-
57-
**assertResultLessEqual(self, value)**
58-
Just like self.assertTrue(self.result() <= value), but with a nicer default message.
59-
Equivalent to `assertLessEqual(self.result(), value)`.
60-
61-
**assertResultList(self, lst)**
62-
Assert that the result is equal to lst.
63-
Equivalent to `assertListEqual(self.result(), lst)`.
64-
65-
**assertResultNot(self, value)**
66-
Fail if the result is equal to the value as determined by the '==' operator.
67-
Equivalent to `assertNotEqual(self.result(), value)`.
68-
69-
**assertResultNotAlmost(self, value, places=None, delta=None)**
70-
Fail if the result is equal to the value as determined by their difference rounded
71-
to the given number of decimal places (default 7) and comparing to zero, or by
72-
comparing that the difference between the two objects is less than the given delta.
73-
Equivalent to `assertNotAlmostEqual(self.result(), value)`.
74-
75-
**assertResultNotIn(self, container)**
76-
Just like self.assertTrue(self.result() not in container), but with a nicer default message.
77-
Equivalent to `assertNotIn(self.result(), container)`.
78-
79-
**assertResultNotRegex(self, unexpected_regex)**
80-
Fail the test if the result matches the regular expression.
81-
Equivalent to `assertNotRegex(self.result(), unexpected_regex)`.
82-
83-
**assertResultRaises(self, expected_exception)**
84-
Fail unless an exception of class expected_exception is raised by the result. If
85-
a different type of exception is raised, it will not be caught, and the test case
86-
will be deemed to have suffered an error, exactly as for an unexpected exception.
87-
Equivalent to
88-
```py
89-
with self.assertRaises(expected_exception):
90-
self.result()
91-
```
92-
93-
**assertResultRaisesRegex(self, expected_exception, expected_regex)**
94-
Fail unless an exception of class expected_exception is raised by the result and the message matches the regex.
95-
Equivalent to
96-
```py
97-
with self.assertRaisesRegex(expected_exception, expected_regex):
98-
self.result()
99-
```
100-
101-
**assertResultRegex(self, expected_regex)**
102-
Fail the test unless the result matches the regular expression.
103-
Equivalent to `self.assertRegex(self.result(), expected_regex)`.
104-
105-
**assertResultSet(self, st)**
106-
Assert that the result is equal to st.
107-
Equivalent to `self.assertSetEqual(self.result(), st)`.
108-
109-
**assertResultTrue(self)**
110-
Check that the result is true.
111-
Equivalent to `self.assertTrue(self.result())`.
112-
113-
**assertResultTuple(self, tpl)**
114-
Assert that the result is equal to tpl.
115-
Equivalent to `self.assertTupleEqual(self.result(), tpl)`.
116-
117-
**cachedResult(self) -> Any**
118-
Return the result of the last `subject` call. Use this function when you want to
119-
assert different attributes of your subject without executing it multiple times.
120-
121-
Raises `unittest_extensions.TestError` if subject has not been called.
122-
123-
**result(self) -> Any**
124-
Result of the `subject` called with arguments defined by the `args` decorator.
1+
::: unittest_extensions.case.TestCase

mkdocs.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ site_url: https://maxcode123.github.io/unittest-extensions/
33
nav:
44
- Home: index.md
55
- API Reference: api_reference.md
6-
theme: readthedocs
6+
theme: readthedocs
7+
plugins:
8+
- mkdocstrings

0 commit comments

Comments
 (0)