Pytest- connection fail

How should we use pytest? Please critique my process.

1.) open terminal , activate my environment and, open local5000 on crome.
2.) Open an additional terminal. Go to the same folder.
open a new terminal and try:" pytest -m connection "
the connection test fails.

The same thing happens with the projection test. I pass on the browser but fail in the terminal

I already answered that question in another thread.

Please do not post duplicate.

I started mongod, opened another terminal and tried pytest again. I still get the same result

actually I got it. I changed the .ini configuration file to the same as production. Thanks Steve. I’m a bit slow lol. Much appreciated.