1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
|
Description: adjust test suite for python3.10.
This patch adjusts expected results after inspect.Signature.from_callable
since this function changed behavior between python3.9 and python3.10. This
may be more of a work around than a genuine proper fix.
Author: Étienne Mollier <[email protected]>
Forwarded: no
Last-Update: 2022-09-03
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- qiime.orig/qiime2/sdk/tests/test_method.py
+++ qiime/qiime2/sdk/tests/test_method.py
@@ -209,15 +209,15 @@
kind = inspect.Parameter.POSITIONAL_OR_KEYWORD
exp_parameters = [
('ints1', inspect.Parameter(
- 'ints1', kind, annotation=IntSequence1 | IntSequence2)),
+ 'ints1', kind, annotation=list)),
('ints2', inspect.Parameter(
- 'ints2', kind, annotation=IntSequence1)),
+ 'ints2', kind, annotation=list)),
('ints3', inspect.Parameter(
- 'ints3', kind, annotation=IntSequence2)),
+ 'ints3', kind, annotation=list)),
('int1', inspect.Parameter(
- 'int1', kind, annotation=Int)),
+ 'int1', kind, annotation=int)),
('int2', inspect.Parameter(
- 'int2', kind, annotation=Int))
+ 'int2', kind, annotation=int))
]
self.assertEqual(parameters, exp_parameters)
@@ -234,9 +234,9 @@
kind = inspect.Parameter.POSITIONAL_OR_KEYWORD
exp_parameters = [
('mapping1', inspect.Parameter(
- 'mapping1', kind, annotation=Mapping)),
+ 'mapping1', kind, annotation=dict)),
('mapping2', inspect.Parameter(
- 'mapping2', kind, annotation=Mapping))
+ 'mapping2', kind, annotation=dict))
]
self.assertEqual(parameters, exp_parameters)
--- qiime.orig/qiime2/sdk/tests/test_visualizer.py
+++ qiime/qiime2/sdk/tests/test_visualizer.py
@@ -6,6 +6,7 @@
# The full license is in the file LICENSE, distributed with this software.
# ----------------------------------------------------------------------------
+import collections
import concurrent.futures
import inspect
import os.path
@@ -181,13 +182,13 @@
kind = inspect.Parameter.POSITIONAL_OR_KEYWORD
exp_parameters = [
('mapping1', inspect.Parameter(
- 'mapping1', kind, annotation=Mapping)),
+ 'mapping1', kind, annotation=dict)),
('mapping2', inspect.Parameter(
- 'mapping2', kind, annotation=Mapping)),
+ 'mapping2', kind, annotation=dict)),
('key_label', inspect.Parameter(
- 'key_label', kind, annotation=Str)),
+ 'key_label', kind, annotation=str)),
('value_label', inspect.Parameter(
- 'value_label', kind, annotation=Str))
+ 'value_label', kind, annotation=str))
]
self.assertEqual(parameters, exp_parameters)
@@ -205,7 +206,7 @@
kind = inspect.Parameter.POSITIONAL_OR_KEYWORD
exp_parameters = [
('ints', inspect.Parameter(
- 'ints', kind, annotation=IntSequence1 | IntSequence2))
+ 'ints', kind, annotation=collections.Counter))
]
self.assertEqual(parameters, exp_parameters)
--- qiime.orig/qiime2/sdk/tests/test_pipeline.py
+++ qiime/qiime2/sdk/tests/test_pipeline.py
@@ -61,13 +61,13 @@
kind = inspect.Parameter.POSITIONAL_OR_KEYWORD
exp_parameters = [
('int_sequence', inspect.Parameter(
- 'int_sequence', kind, annotation=IntSequence1)),
+ 'int_sequence', kind)),
('mapping', inspect.Parameter(
- 'mapping', kind, annotation=Mapping)),
+ 'mapping', kind)),
('do_extra_thing', inspect.Parameter(
- 'do_extra_thing', kind, annotation=Bool)),
+ 'do_extra_thing', kind)),
('add', inspect.Parameter(
- 'add', kind, default=1, annotation=Int))
+ 'add', kind, default=1))
]
for callable_attr in '__call__', 'asynchronous':
|