Resolve "Replace inspect.getargspec references"
Closes #208 (closed)
Edited by Moritz Huebner
Merge request reports
Activity
added 1 commit
- e390d34f - Now uses the utils.core.infer_args_from_method function
added 1 commit
- fa48b2ee - PEP8 and removed tests from Python2 pipeline that don't work in python 2
added 1 commit
- 2f1845ed - Now tries both Python2 and Python3 inspect modules
- Automatically resolved by Moritz Huebner
It looks like you've added a test script and then removed it from the CI. Do you intend to make it run before merging?
EDIT: I see you just removed it from python 2. Can you explain the added functionality in python 3 that justifies this?
Edited by Colm Talbotadded 1 commit
- 24996a86 - Refactored code for inspection utils functions into protected function
@colm.talbot The reason for excluding this is because I am testing that we correctly functions that implement type hinting, e.g.
def foo(a: int, b: float): print('bar')
Type hinting simply does not exist in python 2 and the tests break. There is no good way I have found to work around this without excluding at least the entire test class.
It might not be the neatest solution, but can you define the functions inside the test methods? E.g.,
class TestInferParameters(unittest.TestCase): def setUp(self): pass def tearDown(self): pass @pytest.mark.skipif(sys.version_info < (3, 0), reason="requires Python3") def test_type_hinting(self): def source1(freqs, a, b: int): return None expected = ['a', 'b'] actual = utils.infer_parameters_from_function(source1) self.assertListEqual(expected, actual)
- Resolved by Gregory Ashton
Please register or sign in to reply