Skip to content

Newest version loses Python 2.7 compatibility #128

@kbmeister

Description

@kbmeister

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__'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions