DNS Error when running pytest -m connection

When I run “pytest -m connection” in the command prompt all the tests fail. It seems that the issue is that pytest can’t connect to the cluster due to a DNS error.


Here is my .ini file:

[PROD]
SECRET_KEY = super_secret_key_you_should_change
MFLIX_DB_URI = mongodb+srv://m220student:m220password@mflix-8anup.mongodb.net/test?retryWrites=true&w=majority

[TEST]
SECRET_KEY = super_secret_testing_key
MFLIX_DB_URI = mongodb+srv://m220student:m220password@mflix-8anup.mongodb.net/test?retryWrites=true&w=majority

Hi @Moshe_19207,

I am able to pass the unit-test with the same connection string. Please make sure your firewall is not blocking the request.

Kanika

I discovered that there was a problem with my internet configuration that did not allow the connection. I’ve resolved the issue.

1 Like