Skip to content

Config collision when creating multiple client instances #114

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='foo@example.com', key='abc123', url='https://foo.testrail.net')

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

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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