Connection Test Error

Hello,

I am trying to run test case for connection for first ticket and getting following error(s)

=================================== ERRORS ====================================
_____________________ ERROR at setup of test_atlas_setup ______________________

request = <SubRequest ‘_configure_application’ for <Function ‘test_atlas_setup’>>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x000001C4AD360748>

@pytest.fixture(autouse=True)
def _configure_application(request, monkeypatch):
    """Use `pytest.mark.options` decorator to pass options to your application
    factory::

        @pytest.mark.options(debug=False)
        def test_something(app):
            assert not app.debug, 'the application works not in debug mode!'

    """
    if 'app' not in request.fixturenames:
        return
  app = request.getfuncargvalue('app')

E _pytest.warning_types.RemovedInPytest4Warning: getfuncargvalue is deprecated, use getfixturevalue

…\python~1\mflix-~1\mflix_~1\lib\site-packages\pytest_flask\plugin.py:109: RemovedInPytest4Warning
_____________________ ERROR at setup of test_basic_movies _____________________

request = <SubRequest ‘_configure_application’ for <Function ‘test_basic_movies’>>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x000001C4AD360208>

@pytest.fixture(autouse=True)
def _configure_application(request, monkeypatch):
    """Use `pytest.mark.options` decorator to pass options to your application
    factory::

        @pytest.mark.options(debug=False)
        def test_something(app):
            assert not app.debug, 'the application works not in debug mode!'

    """
    if 'app' not in request.fixturenames:
        return
  app = request.getfuncargvalue('app')

…\python~1\mflix-~1\mflix_~1\lib\site-packages\pytest_flask\plugin.py:109:


request = <SubRequest ‘_configure_application’ for <Function ‘test_atlas_setup’>>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x000001C4AD360748>

@pytest.fixture(autouse=True)
def _configure_application(request, monkeypatch):
    """Use `pytest.mark.options` decorator to pass options to your application
    factory::

        @pytest.mark.options(debug=False)
        def test_something(app):
            assert not app.debug, 'the application works not in debug mode!'

    """
    if 'app' not in request.fixturenames:
        return
  app = request.getfuncargvalue('app')

E _pytest.warning_types.RemovedInPytest4Warning: getfuncargvalue is deprecated, use getfixturevalue

…\python~1\mflix-~1\mflix_~1\lib\site-packages\pytest_flask\plugin.py:109: RemovedInPytest4Warning
__________________ ERROR at setup of test_search_by_movie_id __________________

request = <SubRequest ‘_configure_application’ for <Function ‘test_search_by_movie_id’>>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x000001C4AD3B6240>

@pytest.fixture(autouse=True)
def _configure_application(request, monkeypatch):
    """Use `pytest.mark.options` decorator to pass options to your application
    factory::

        @pytest.mark.options(debug=False)
        def test_something(app):
            assert not app.debug, 'the application works not in debug mode!'

    """
    if 'app' not in request.fixturenames:
        return
  app = request.getfuncargvalue('app')

…\python~1\mflix-~1\mflix_~1\lib\site-packages\pytest_flask\plugin.py:109:


…\python~1\mflix-~1\mflix_~1\lib\site-packages\pytest_flask\plugin.py:109: in _configure_application
app = request.getfuncargvalue(‘app’)


request = <SubRequest ‘_configure_application’ for <Function ‘test_atlas_setup’>>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x000001C4AD360748>

@pytest.fixture(autouse=True)
def _configure_application(request, monkeypatch):
    """Use `pytest.mark.options` decorator to pass options to your application
    factory::

        @pytest.mark.options(debug=False)
        def test_something(app):
            assert not app.debug, 'the application works not in debug mode!'

    """
    if 'app' not in request.fixturenames:
        return
  app = request.getfuncargvalue('app')

E _pytest.warning_types.RemovedInPytest4Warning: getfuncargvalue is deprecated, use getfixturevalue

…\python~1\mflix-~1\mflix_~1\lib\site-packages\pytest_flask\plugin.py:109: RemovedInPytest4Warning
__________________ ERROR at setup of test_simple_text_search __________________

request = <SubRequest ‘_configure_application’ for <Function ‘test_simple_text_search’>>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x000001C4AD360A20>

@pytest.fixture(autouse=True)
def _configure_application(request, monkeypatch):
    """Use `pytest.mark.options` decorator to pass options to your application
    factory::

        @pytest.mark.options(debug=False)
        def test_something(app):
            assert not app.debug, 'the application works not in debug mode!'

    """
    if 'app' not in request.fixturenames:
        return
  app = request.getfuncargvalue('app')

…\python~1\mflix-~1\mflix_~1\lib\site-packages\pytest_flask\plugin.py:109:


…\python~1\mflix-~1\mflix_~1\lib\site-packages\pytest_flask\plugin.py:109: in configure_application
app = request.getfuncargvalue(‘app’)
…\python~1\mflix-~1\mflix
~1\lib\site-packages\pytest_flask\plugin.py:109: in _configure_application
app = request.getfuncargvalue(‘app’)


request = <SubRequest ‘_configure_application’ for <Function ‘test_atlas_setup’>>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x000001C4AD360748>

@pytest.fixture(autouse=True)
def _configure_application(request, monkeypatch):
    """Use `pytest.mark.options` decorator to pass options to your application
    factory::

        @pytest.mark.options(debug=False)
        def test_something(app):
            assert not app.debug, 'the application works not in debug mode!'

    """
    if 'app' not in request.fixturenames:
        return
  app = request.getfuncargvalue('app')

E _pytest.warning_types.RemovedInPytest4Warning: getfuncargvalue is deprecated, use getfixturevalue

…\python~1\mflix-~1\mflix_~1\lib\site-packages\pytest_flask\plugin.py:109: RemovedInPytest4Warning
=================== 39 deselected, 4 error in 0.33 seconds ====================

Can some one help?

And here is the content of my .ini file

Ticket: Connection

Rename this file to .ini after filling in your MFLIX_DB_URI and your SECRET_KEY

Do not surround the URI with quotes

[PROD]

SECRET_KEY = Meghal

MFLIX_DB_URI = mongodb+srv://m220student:@mflix-ifxir.mongodb.net/test?retryWrites=true

[TEST]

SECRET_KEY = MeghalTest

MFLIX_DB_URI = mongodb+srv://m220student:@mflix-ifxir.mongodb.net/test?retryWrites=true

I assume that in your real “.ini” file you actually did insert the password as well. Correct?

Yes I have inserted correct password

Could you please show the literal command you’re giving to run the test?

Also, have you tested the connection string that you use in the “.ini” file with the Mongo shell? Does it work over there?

The command that I used was
pytest -m connection

I am able to run application using python run.py

For some reason I am not able to import pytest module and I think these errors are because of that. I tried installing pytest using pip but it says requirement already satisfied.

I thought it was:

pytest -m test_db_connection

Check for the actual name in the “tests” directory. You only have to leave off the file extension.

That helped!!

Thanks @ Tess_Sluijter

Hello Tess_Sluijter,

I am facing connection issues, Could you plz guide me,.

Microsoft Windows [Version 6.3.9600]
© 2013 Microsoft Corporation. All rights reserved.

D:\MongoDbPython\mflix-python(1)>pytest -m test_db_connection
ImportError while loading conftest ‘D:\MongoDbPython\mflix-python(1)\tests\conft
est.py’.
tests\conftest.py:2: in
from mflix.factory import create_app
mflix\factory.py:6: in
from flask_bcrypt import Bcrypt
E ModuleNotFoundError: No module named ‘flask_bcrypt’

D:\MongoDbPython\mflix-python(1)>

It seems that not all the Python modules were installed @Abhishek_14341. That’s the pip install -r requirements.txt they have you do… Did that step work alright for you?

Hello Sir,
Yes I followed that file n installed everything as per my knowledge,
"Flask==0.12.4
Flask-Bcrypt==0.7.1
Flask-Login==0.4.0
pymongo==3.7.0
dnspython==1.15.0
pytest-flask==0.10.0
Flask-Cors==3.0.3
flask-jwt-extended==3.7.0
faker==0.8.13
jupyter==1.0.0
jupyter-client==5.2.3
jupyter-console==5.2.0
jupyter-core==4.4.0
"

These are what I installed by the help of PIP but now m getting another issues. as follow as plz help me ,

Microsoft Windows [Version 6.3.9600]
© 2013 Microsoft Corporation. All rights reserved.

D:\MongoDbPython\mflix-python(1)>pytest -m connection
ImportError while loading conftest ‘D:\MongoDbPython\mflix-python(1)\tests\conft
est.py’.
tests\conftest.py:2: in
from mflix.factory import create_app
mflix\factory.py:9: in
from bson import json_util, ObjectId
c:\users\araj\appdata\local\continuum\anaconda3\lib\site-packages\bson\json_util
.py:125: in
from pymongo.errors import ConfigurationError
c:\users\araj\appdata\local\continuum\anaconda3\lib\site-packages\pymongo__init
__.py:77: in
from pymongo.collection import ReturnDocument
c:\users\araj\appdata\local\continuum\anaconda3\lib\site-packages\pymongo\collec
tion.py:20: in
from bson.code import Code
c:\users\araj\appdata\local\continuum\anaconda3\lib\site-packages\bson\code.py:1
8: in
from bson.py3compat import abc, string_type, PY3, text_type
E ImportError: cannot import name ‘abc’

D:\MongoDbPython\mflix-python(1)>

Based on a quick Google search, it looks like this setup requires Python 3, while your setup apparently uses Python 2. Could that be possible? Can you show us the Python version?

Hello Sir,

Yes , please refer my following CLI output regardiing Python version .
Microsoft Windows [Version 6.3.9600]
© 2013 Microsoft Corporation. All rights reserved.

C:\Users\araj>python
Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bi
t (AMD64)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.

@Tess_Sluijter i ran the db_connection test but in the status page, the connection couldnt validateta

i guess my error was in importing data, i re-imported again and passed the test but im still failing valdationta

hello everyone,

If anyone is getting the following error while running the connection test

E _pytest.warning_types.RemovedInPytest4Warning: getfuncargvalue is deprecated, use getfixturevalue

Do this, check your pytest_flask version to match the following
Run pip show pytest_flask

It will show following output

    Name: pytest-flask
    Version: 0.14.0
    Summary: A set of py.test fixtures to test Flask applications.
    Home-page: https://github.com/vitalk/pytest-flask
    Author: Vital Kudzelka
    Author-email: vital.kudzelka@gmail.com
    License: MIT
    Location: /home/codedem/Development/learn/mongo/python/env/lib/python3.6/site-packages
    Requires: Werkzeug, Flask, pytest, pytest
    Required-by: 

make sure it’s latest in my case it’s Version: 0.14.0 and it does resolved my issue. I had the same error

To update use
pip install pytest_flask --upgrade

1 Like

I have followed all the steps in the README file but i’m still getting: 4 failed/39 deselected upon running pytest -m connection. I have read most of the responses here and i’m at a loss as to what to do.
This is output for the connection test:

(base) C:\Users\tneha\Desktop\mflix-python>pytest -m connection
============================= test session starts =============================
platform win32 -- Python 3.6.5, pytest-3.6.0, py-1.5.3, pluggy-0.6.0
rootdir: C:\Users\tneha\Desktop\mflix-python, inifile:
plugins: remotedata-0.2.1, openfiles-0.3.0, flask-0.14.0, doctestplus-0.1.3, arraydiff-0.2
collected 43 items / 39 deselected

tests\test_db_connection.py FFFF                                         [100%]

================================== FAILURES ===================================
______________________________ test_atlas_setup _______________________________

client = <FlaskClient <Flask 'mflix.factory'>>
config = <Config {'DEBUG': False, 'TESTING': False, 'PROPAGATE_EXCEPTIONS': True, 'PRESERVE_CONTEXT_ON_EXCEPTION': None, 'SECRE...00021C066DB048>, 'CLAIMS_LOADER': <function create_app.<locals>.add_claims at 0x0000021C08D8A488>, 'MFLIX_DB_URI': ''}>

    @pytest.mark.connection
    @pytest.mark.usefixtures('config')
    def test_atlas_setup(client, config):
>       result = get_coll_names(config)

tests\test_db_connection.py:24:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests\test_db_connection.py:17: in get_coll_names
    db = MongoClient(config['MFLIX_DB_URI'])["mflix"]
..\..\anaconda\anaconda3\lib\site-packages\pymongo\mongo_client.py:501: in __init__
    seeds.update(uri_parser.split_hosts(entity, port))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

hosts = '', default_port = 27017

    def split_hosts(hosts, default_port=DEFAULT_PORT):
        """Takes a string of the form host1[:port],host2[:port]... and
        splits it into (host, port) tuples. If [:port] isn't present the
        default_port is used.

        Returns a set of 2-tuples containing the host name (or IP) followed by
        port number.

        :Parameters:
            - `hosts`: A string of the form host1[:port],host2[:port],...
            - `default_port`: The port number to use when one wasn't specified
              for a host.
        """
        nodes = []
        for entity in hosts.split(','):
            if not entity:
>               raise ConfigurationError("Empty host "
                                         "(or extra comma in host list).")
E               pymongo.errors.ConfigurationError: Empty host (or extra comma in host list).

..\..\anaconda\anaconda3\lib\site-packages\pymongo\uri_parser.py:254: ConfigurationError
______________________________ test_basic_movies ______________________________

client = <FlaskClient <Flask 'mflix.factory'>>

    @pytest.mark.connection
    def test_basic_movies(client):
>       (actual, num_found) = get_movies({}, 0, 20)

tests\test_db_connection.py:31:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
mflix\db.py:219: in get_movies
    cursor = db.movies.find(query).sort(sort)
..\..\anaconda\anaconda3\lib\site-packages\werkzeug\local.py:347: in __getattr__
    return getattr(self._get_current_object(), name)
..\..\anaconda\anaconda3\lib\site-packages\werkzeug\local.py:306: in _get_current_object
    return self.__local()
mflix\db.py:46: in get_db
    MFLIX_DB_URI,
..\..\anaconda\anaconda3\lib\site-packages\pymongo\mongo_client.py:501: in __init__
    seeds.update(uri_parser.split_hosts(entity, port))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

hosts = '', default_port = 27017

    def split_hosts(hosts, default_port=DEFAULT_PORT):
        """Takes a string of the form host1[:port],host2[:port]... and
        splits it into (host, port) tuples. If [:port] isn't present the
        default_port is used.

        Returns a set of 2-tuples containing the host name (or IP) followed by
        port number.

        :Parameters:
            - `hosts`: A string of the form host1[:port],host2[:port],...
            - `default_port`: The port number to use when one wasn't specified
              for a host.
        """
        nodes = []
        for entity in hosts.split(','):
            if not entity:
>               raise ConfigurationError("Empty host "
                                         "(or extra comma in host list).")
E               pymongo.errors.ConfigurationError: Empty host (or extra comma in host list).

..\..\anaconda\anaconda3\lib\site-packages\pymongo\uri_parser.py:254: ConfigurationError
___________________________ test_search_by_movie_id ___________________________

client = <FlaskClient <Flask 'mflix.factory'>>

    @pytest.mark.connection
    def test_search_by_movie_id(client):
        actual = get_movie("573a13eff29313caabdd82f3")
>       assert actual['title'] == 'The Martian'
E       KeyError: 'title'

tests\test_db_connection.py:39: KeyError
___________________________ test_simple_text_search ___________________________

client = <FlaskClient <Flask 'mflix.factory'>>

    @pytest.mark.connection
    def test_simple_text_search(client):
>       (actual, _) = get_movies({"$text": {"$search": "The Martian"}}, 0, 20)

tests\test_db_connection.py:44:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
mflix\db.py:219: in get_movies
    cursor = db.movies.find(query).sort(sort)
..\..\anaconda\anaconda3\lib\site-packages\werkzeug\local.py:347: in __getattr__
    return getattr(self._get_current_object(), name)
..\..\anaconda\anaconda3\lib\site-packages\werkzeug\local.py:306: in _get_current_object
    return self.__local()
mflix\db.py:46: in get_db
    MFLIX_DB_URI,
..\..\anaconda\anaconda3\lib\site-packages\pymongo\mongo_client.py:501: in __init__
    seeds.update(uri_parser.split_hosts(entity, port))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

hosts = '', default_port = 27017

    def split_hosts(hosts, default_port=DEFAULT_PORT):
        """Takes a string of the form host1[:port],host2[:port]... and
        splits it into (host, port) tuples. If [:port] isn't present the
        default_port is used.

        Returns a set of 2-tuples containing the host name (or IP) followed by
        port number.

        :Parameters:
            - `hosts`: A string of the form host1[:port],host2[:port],...
            - `default_port`: The port number to use when one wasn't specified
              for a host.
        """
        nodes = []
        for entity in hosts.split(','):
            if not entity:
>               raise ConfigurationError("Empty host "
                                         "(or extra comma in host list).")
E               pymongo.errors.ConfigurationError: Empty host (or extra comma in host list).

..\..\anaconda\anaconda3\lib\site-packages\pymongo\uri_parser.py:254: ConfigurationError
=================== 4 failed, 39 deselected in 0.59 seconds ===================

Can you show us the configuration you made in .env? Your program is complaining that you did bot provide a URI.

[PROD]

SECRET_KEY = nfkdjddj
MFLIX_DB_URI = mongodb+srv://m220student:m220password@mflix-eqgx8.mongodb.net/test
[TEST]

SECRET_KEY = sadakljdlkjd
MFLIX_DB_URI = 
mongodb+srv://m220student:m220password@mflix-eqgx8.mongodb.net/test
1 Like

Changed the db.py code a little since the last post. Getting the same errors though. Thanks for responding!

(base) C:\Users\tneha\Desktop\mflix-python>pytest -m connection
============================= test session starts =============================
platform win32 -- Python 3.6.5, pytest-3.6.0, py-1.5.3, pluggy-0.6.0
rootdir: C:\Users\tneha\Desktop\mflix-python, inifile:
plugins: remotedata-0.2.1, openfiles-0.3.0, flask-0.14.0, doctestplus-0.1.3, arraydiff-0.2
collected 43 items / 39 deselected

tests\test_db_connection.py FFFF                                         [100%]

================================== FAILURES ===================================
______________________________ test_atlas_setup _______________________________

client = <FlaskClient <Flask 'mflix.factory'>>
config = <Config {'DEBUG': False, 'TESTING': False, 'PROPAGATE_EXCEPTIONS': True, 'PRESERVE_CONTEXT_ON_EXCEPTION': None, 'SECRE...000223D732E2E8>, 'CLAIMS_LOADER': <function create_app.<locals>.add_claims at 0x00000223D734A488>, 'MFLIX_DB_URI': ''}>

    @pytest.mark.connection
    @pytest.mark.usefixtures('config')
    def test_atlas_setup(client, config):
>       result = get_coll_names(config)

tests\test_db_connection.py:24:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests\test_db_connection.py:17: in get_coll_names
    db = MongoClient(config['MFLIX_DB_URI'])["mflix"]
..\..\anaconda\anaconda3\lib\site-packages\pymongo\mongo_client.py:501: in __init__
    seeds.update(uri_parser.split_hosts(entity, port))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

hosts = '', default_port = 27017

    def split_hosts(hosts, default_port=DEFAULT_PORT):
        """Takes a string of the form host1[:port],host2[:port]... and
        splits it into (host, port) tuples. If [:port] isn't present the
        default_port is used.

        Returns a set of 2-tuples containing the host name (or IP) followed by
        port number.

        :Parameters:
            - `hosts`: A string of the form host1[:port],host2[:port],...
            - `default_port`: The port number to use when one wasn't specified
              for a host.
        """
        nodes = []
        for entity in hosts.split(','):
            if not entity:
>               raise ConfigurationError("Empty host "
                                         "(or extra comma in host list).")
E               pymongo.errors.ConfigurationError: Empty host (or extra comma in host list).

..\..\anaconda\anaconda3\lib\site-packages\pymongo\uri_parser.py:254: ConfigurationError
______________________________ test_basic_movies ______________________________

client = <FlaskClient <Flask 'mflix.factory'>>

    @pytest.mark.connection
    def test_basic_movies(client):
>       (actual, num_found) = get_movies({}, 0, 20)

tests\test_db_connection.py:31:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
mflix\db.py:217: in get_movies
    cursor = db.movies.find(query).sort(sort)
..\..\anaconda\anaconda3\lib\site-packages\werkzeug\local.py:347: in __getattr__
    return getattr(self._get_current_object(), name)
..\..\anaconda\anaconda3\lib\site-packages\werkzeug\local.py:306: in _get_current_object
    return self.__local()
mflix\db.py:48: in get_db
    connectTimeoutMS=2500
..\..\anaconda\anaconda3\lib\site-packages\pymongo\mongo_client.py:501: in __init__
    seeds.update(uri_parser.split_hosts(entity, port))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

hosts = '', default_port = 27017

    def split_hosts(hosts, default_port=DEFAULT_PORT):
        """Takes a string of the form host1[:port],host2[:port]... and
        splits it into (host, port) tuples. If [:port] isn't present the
        default_port is used.

        Returns a set of 2-tuples containing the host name (or IP) followed by
        port number.

        :Parameters:
            - `hosts`: A string of the form host1[:port],host2[:port],...
            - `default_port`: The port number to use when one wasn't specified
              for a host.
        """
        nodes = []
        for entity in hosts.split(','):
            if not entity:
>               raise ConfigurationError("Empty host "
                                         "(or extra comma in host list).")
E               pymongo.errors.ConfigurationError: Empty host (or extra comma in host list).

..\..\anaconda\anaconda3\lib\site-packages\pymongo\uri_parser.py:254: ConfigurationError
___________________________ test_search_by_movie_id ___________________________

client = <FlaskClient <Flask 'mflix.factory'>>

    @pytest.mark.connection
    def test_search_by_movie_id(client):
        actual = get_movie("573a13eff29313caabdd82f3")
>       assert actual['title'] == 'The Martian'
E       KeyError: 'title'

tests\test_db_connection.py:39: KeyError
___________________________ test_simple_text_search ___________________________

client = <FlaskClient <Flask 'mflix.factory'>>

    @pytest.mark.connection
    def test_simple_text_search(client):
>       (actual, _) = get_movies({"$text": {"$search": "The Martian"}}, 0, 20)

tests\test_db_connection.py:44:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
mflix\db.py:217: in get_movies
    cursor = db.movies.find(query).sort(sort)
..\..\anaconda\anaconda3\lib\site-packages\werkzeug\local.py:347: in __getattr__
    return getattr(self._get_current_object(), name)
..\..\anaconda\anaconda3\lib\site-packages\werkzeug\local.py:306: in _get_current_object
    return self.__local()
mflix\db.py:48: in get_db
    connectTimeoutMS=2500
..\..\anaconda\anaconda3\lib\site-packages\pymongo\mongo_client.py:501: in __init__
    seeds.update(uri_parser.split_hosts(entity, port))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

hosts = '', default_port = 27017

    def split_hosts(hosts, default_port=DEFAULT_PORT):
        """Takes a string of the form host1[:port],host2[:port]... and
        splits it into (host, port) tuples. If [:port] isn't present the
        default_port is used.

        Returns a set of 2-tuples containing the host name (or IP) followed by
        port number.

        :Parameters:
            - `hosts`: A string of the form host1[:port],host2[:port],...
            - `default_port`: The port number to use when one wasn't specified
              for a host.
        """
        nodes = []
        for entity in hosts.split(','):
            if not entity:
>               raise ConfigurationError("Empty host "
                                         "(or extra comma in host list).")
E               pymongo.errors.ConfigurationError: Empty host (or extra comma in host list).

..\..\anaconda\anaconda3\lib\site-packages\pymongo\uri_parser.py:254: ConfigurationError
=================== 4 failed, 39 deselected in 0.63 seconds ===================