Repository navigation
Commit 920431b
committed
TST: use
for compatibility with Python 3.10.
The package `nose` is not compatible with Python 3.10,
because it imports abstract base classes from the
module `collections`,
[`nose == 1.3.7`](https://pypi.org/project/nose/1.3.7/#history)
imports in Python 3.10 without error, but `nosetests` fails,
due to imports from the module `collections` of classes that
have moved to the module `collections.abc`. The error raised contains:
```
File ".../.virtualenvs/.../lib/python3.10/site-packages/nose/suite.py", line 106, in _set_tests
if isinstance(tests, collections.Callable) and not is_suite:
AttributeError: module 'collections' has no attribute 'Callable'
```
Relevant information about CPython changes in `collections` (removal of
ABCs):
- python/cpython#23754
- https://bugs.python.org/issue37324
- https://docs.python.org/3.10/library/collections.abc.html#collections-abstract-base-classes
- Deprecation since Python 3.3, present until Python 3.9:
https://docs.python.org/3.9/library/collections.html#module-collections
- Removed in Python 3.10:
https://docs.python.org/3.10/whatsnew/3.10.html#removed
The script `run_tests.py` is rewritten, based on `pytest` functionality.
The file `test/transys_mathset_test.py` has been changed to mode 100644
in order to not need an equivalent `pytest` option for option `--exe`
of `nose`.
In the test script `tests/mathfunc_test.py`, the function
`_get_state_input_output_pair_test` has been renamed to
`_get_state_input_pair` to avoid its name being matched by the
pattern `python_functions = test_* *_test` defined in the
configuration file `tests/pytest.ini`.pytest, instead of nose
1 parent f38f0f0 commit 920431b
30 files changed
Lines changed: 456 additions & 376 deletions
File tree
- contrib
- doc
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
| 32 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
92 | | - | |
93 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| |||
0 commit comments