Cannot connect pytest -m connection

Hi,

I am trying to run pytest -m connection and get the following error message:

I already installed the pip install -r requirements.txt twice since this was one suggestion in another post. But I still get the error message.

Additionally, I checked if the srv string is correct. Since I can connect to the MongoDB Compass with the string I think this should not cause the error.

Furthermore, I can run the python run.py - so this is working.

It will be great if someone can help me. Many thanks in advance!

Kind regards,
BEatrice

Welcome to the community @Beatrice_Schwab. Can you post the complete code of test_db_connection,.py and the complete error output?

I suspect that you might be running the tests from the wrong directory.

You should be running the tests in the same directory as the one you do python run.py.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.