Skip to content

Config collision when creating multiple client instances #114

@lbjay

Description

@lbjay

It is not possible to create multiple client instances to different testrail accounts within a single session. A brief glance at the code in api.py suggests it's probably related to config settings being stored in API class attributes.

In [1]: from testrail import TestRail

In [2]: tr1 = TestRail(project_id=1, email='[email protected]', key='abc123', url='https://foo.testrail.net')

In [3]: tr2 = TestRail(project_id=1, email='[email protected]', key='xyz999', url='https://bar.testrail.net')

In [4]: tr2.api._config
Out[4]: 
{'email': '[email protected]',
 'key': 'xyz999',
 'url': 'https://bar.testrail.net'}

In [5]: tr1.api._config
Out[5]: 
{'email': '[email protected]',
 'key': 'xyz999',
 'url': 'https://bar.testrail.net'}

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