Commit 409bae8
committed
Align setUp and tearDown type signatures with unittest and rdflib.plugin
The references below indicate the type requirements' sources.
When reviewing subclasses of `GraphTestCase`, `setUp` and `tearDown` did
no further work than the parent class `GraphTestCase` once the
signatures were aligned with `typeshed.stdlib`, so the methods were
removed.
This patch was driven by the following command after activating type
review on `setUp` and `tearDown` (adding `-> None`):
```bash
mypy test/test_sqlalchemy_sqlite.py
```
This patch was then tested with the following command after identifying
sibling ("cousin?") classes of the SQLite test. This command raised no
errors after deactivating type review (adding `# type: ignore`) on a
package that does not currently provide type signatures:
```bash
mypy \
test/test_sqlalchemy_mysql.py \
test/test_sqlalchemy_postgresql.py \
test/test_sqlalchemy_postgresql_pg8000.py \
test/test_sqlalchemy_sqlite.py
```
Disclaimer:
Participation by NIST in the creation of the documentation of mentioned
software is not intended to imply a recommendation or endorsement by the
National Institute of Standards and Technology, nor is it intended to
imply that any specific software is necessarily the best available for
the purpose.
References:
* https://github.com/RDFLib/rdflib/blob/7.1.1/rdflib/plugin.py#L128
* https://github.com/python/typeshed/blob/b40eb642e00c538e29fb037992eb4b21d9ff108c/stdlib/unittest/case.pyi#L119-L120
Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>1 parent 99f4689 commit 409bae8
File tree
5 files changed
+10
-69
lines changed- test
5 files changed
+10
-69
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
| |||
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
26 | | - | |
27 | | - | |
| 30 | + | |
| 31 | + | |
28 | 32 | | |
29 | | - | |
| 33 | + | |
30 | 34 | | |
31 | | - | |
32 | | - | |
| 35 | + | |
| 36 | + | |
33 | 37 | | |
34 | 38 | | |
35 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | 42 | | |
49 | 43 | | |
50 | 44 | | |
51 | 45 | | |
52 | 46 | | |
53 | 47 | | |
54 | 48 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | 49 | | |
63 | 50 | | |
64 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | 33 | | |
43 | 34 | | |
44 | 35 | | |
45 | 36 | | |
46 | 37 | | |
47 | 38 | | |
48 | 39 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | 40 | | |
59 | 41 | | |
60 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | 36 | | |
46 | 37 | | |
47 | 38 | | |
| |||
51 | 42 | | |
52 | 43 | | |
53 | 44 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | 45 | | |
64 | 46 | | |
65 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | 25 | | |
33 | 26 | | |
34 | 27 | | |
35 | 28 | | |
36 | 29 | | |
37 | 30 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | 31 | | |
46 | 32 | | |
47 | 33 | | |
| |||
0 commit comments