Pytest -m connection throwing OperationError

on running the test, getting below response:-
response = {‘code’: 8000, ‘codeName’: ‘AtlasError’, ‘errmsg’: ‘bad auth Authentication failed.’, ‘ok’: 0}, msg = ‘%s’, allowable_errors = None, parse_write_concern_error = False

Please make sure the username and password are correct. Sometimes, a white space gets appended when we copy/paste. :slight_smile:

You can test the connection string by connecting from the command line like below:

 $ mongo mongodb+srv://m220student:m220password@mflix-xx.mongodb.net/test

Kanika

Hi it worked, there was an extra space after MFLIX_DB_URI = srv string causing the error

thanks,
Pratik

1 Like

Glad to hear it @pratik_anurag. Closing this issue now.

Kanika