testrail-python icon indicating copy to clipboard operation
testrail-python copied to clipboard

Newest version loses Python 2.7 compatibility

Open kbmeister opened this issue 7 years ago • 0 comments

The April changes to helper.py appear to use parts of the re module API (specifically getting numerical indexes on a re.match object) that are in Python 3 only. The package, as installed from pip 2, no longer works under Python 2.7 as a result.

>>> tr.cases(ste)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/kbemister/Library/Python/2.7/lib/python/site-packages/testrail/client.py", line 269, in cases
    return map(Case, self.api.cases(self._project_id, suite.id))
  File "/Users/kbmeister/Library/Python/2.7/lib/python/site-packages/testrail/case.py", line 22, in __init__
    self._custom_methods = custom_methods(self._content)
  File "/Users/kbmeister/Library/Python/2.7/lib/python/site-packages/testrail/helper.py", line 83, in custom_methods
    return dict({match[1]: match[0] for match in matches if match})
  File "/Users/kbmeister/Library/Python/2.7/lib/python/site-packages/testrail/helper.py", line 83, in <dictcomp>
    return dict({match[1]: match[0] for match in matches if match})
TypeError: '_sre.SRE_Match' object has no attribute '__getitem__'

kbmeister avatar Jun 15 '18 00:06 kbmeister