Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-3190

Test Failure - doctests failing cannot import name 'TypedDict'

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 4.1
    • Affects Version/s: None
    • Component/s: Tests
    • None

      doctests are failing due to PYTHON-3074:

       [2022/03/31 07:44:17.412] Document: examples/type_hints
       [2022/03/31 07:44:17.412] -----------------------------
       [2022/03/31 07:44:17.412] **********************************************************************
       [2022/03/31 07:44:17.412] File "examples/type_hints.rst", line 97, in default
       [2022/03/31 07:44:17.412] Failed example:
       [2022/03/31 07:44:17.412]     from typing import TypedDict
       [2022/03/31 07:44:17.412] Exception raised:
       [2022/03/31 07:44:17.412]     Traceback (most recent call last):
       [2022/03/31 07:44:17.412]       File "/opt/python/3.6/lib/python3.6/doctest.py", line 1330, in __run
       [2022/03/31 07:44:17.412]         compileflags, 1), test.globs)
       [2022/03/31 07:44:17.412]       File "<doctest default[0]>", line 1, in <module>
       [2022/03/31 07:44:17.412]         from typing import TypedDict
       [2022/03/31 07:44:17.412]     ImportError: cannot import name 'TypedDict'
       [2022/03/31 07:44:17.413] **********************************************************************
       [2022/03/31 07:44:17.413] File "examples/type_hints.rst", line 98, in default
       [2022/03/31 07:44:17.413] Failed example:
       [2022/03/31 07:44:17.413]     from pymongo import MongoClient, Collection
       [2022/03/31 07:44:17.413] Exception raised:
       [2022/03/31 07:44:17.413]     Traceback (most recent call last):
       [2022/03/31 07:44:17.413]       File "/opt/python/3.6/lib/python3.6/doctest.py", line 1330, in __run
       [2022/03/31 07:44:17.413]         compileflags, 1), test.globs)
       [2022/03/31 07:44:17.413]       File "<doctest default[1]>", line 1, in <module>
       [2022/03/31 07:44:17.413]         from pymongo import MongoClient, Collection
       [2022/03/31 07:44:17.413]     ImportError: cannot import name 'Collection'
       [2022/03/31 07:44:17.413] **********************************************************************
       [2022/03/31 07:44:17.413] File "examples/type_hints.rst", line 99, in default
       [2022/03/31 07:44:17.413] Failed example:
       [2022/03/31 07:44:17.413]     class Movie(TypedDict):
       [2022/03/31 07:44:17.413]           name: str
       [2022/03/31 07:44:17.413]           year: int
       [2022/03/31 07:44:17.413] Exception raised:
       [2022/03/31 07:44:17.413]     Traceback (most recent call last):
       [2022/03/31 07:44:17.413]       File "/opt/python/3.6/lib/python3.6/doctest.py", line 1330, in __run
       [2022/03/31 07:44:17.413]         compileflags, 1), test.globs)
       [2022/03/31 07:44:17.413]       File "<doctest default[2]>", line 1, in <module>
       [2022/03/31 07:44:17.413]         class Movie(TypedDict):
       [2022/03/31 07:44:17.413]     NameError: name 'TypedDict' is not defined
       [2022/03/31 07:44:17.415] **********************************************************************
       [2022/03/31 07:44:17.415] File "examples/type_hints.rst", line 104, in default
       [2022/03/31 07:44:17.415] Failed example:
       [2022/03/31 07:44:17.415]     collection: Collection[Movie] = client.test.test
       [2022/03/31 07:44:17.415] Exception raised:
       [2022/03/31 07:44:17.415]     Traceback (most recent call last):
       [2022/03/31 07:44:17.415]       File "/opt/python/3.6/lib/python3.6/doctest.py", line 1330, in __run
       [2022/03/31 07:44:17.415]         compileflags, 1), test.globs)
       [2022/03/31 07:44:17.415]       File "<doctest default[4]>", line 1, in <module>
       [2022/03/31 07:44:17.415]         collection: Collection[Movie] = client.test.test
       [2022/03/31 07:44:17.415]     NameError: name 'Collection' is not defined
       [2022/03/31 07:44:17.420] **********************************************************************
       [2022/03/31 07:44:17.420] File "examples/type_hints.rst", line 119, in default
       [2022/03/31 07:44:17.420] Failed example:
       [2022/03/31 07:44:17.420]     from typing import TypedDict
       [2022/03/31 07:44:17.420] Exception raised:
       [2022/03/31 07:44:17.420]     Traceback (most recent call last):
       [2022/03/31 07:44:17.420]       File "/opt/python/3.6/lib/python3.6/doctest.py", line 1330, in __run
       [2022/03/31 07:44:17.420]         compileflags, 1), test.globs)
       [2022/03/31 07:44:17.420]       File "<doctest default[0]>", line 1, in <module>
       [2022/03/31 07:44:17.420]         from typing import TypedDict
       [2022/03/31 07:44:17.420]     ImportError: cannot import name 'TypedDict'
       [2022/03/31 07:44:17.420] **********************************************************************
       [2022/03/31 07:44:17.420] File "examples/type_hints.rst", line 120, in default
       [2022/03/31 07:44:17.420] Failed example:
       [2022/03/31 07:44:17.421]     from pymongo import MongoClient, Database
       [2022/03/31 07:44:17.421] Exception raised:
       [2022/03/31 07:44:17.421]     Traceback (most recent call last):
       [2022/03/31 07:44:17.421]       File "/opt/python/3.6/lib/python3.6/doctest.py", line 1330, in __run
       [2022/03/31 07:44:17.421]         compileflags, 1), test.globs)
       [2022/03/31 07:44:17.421]       File "<doctest default[1]>", line 1, in <module>
       [2022/03/31 07:44:17.421]         from pymongo import MongoClient, Database
       [2022/03/31 07:44:17.421]     ImportError: cannot import name 'Database'
       [2022/03/31 07:44:17.421] **********************************************************************
       [2022/03/31 07:44:17.421] File "examples/type_hints.rst", line 121, in default
       [2022/03/31 07:44:17.421] Failed example:
       [2022/03/31 07:44:17.421]     class Movie(TypedDict):
       [2022/03/31 07:44:17.421]           name: str
       [2022/03/31 07:44:17.421]           year: int
       [2022/03/31 07:44:17.421] Exception raised:
       [2022/03/31 07:44:17.421]     Traceback (most recent call last):
       [2022/03/31 07:44:17.421]       File "/opt/python/3.6/lib/python3.6/doctest.py", line 1330, in __run
       [2022/03/31 07:44:17.421]         compileflags, 1), test.globs)
       [2022/03/31 07:44:17.421]       File "<doctest default[2]>", line 1, in <module>
       [2022/03/31 07:44:17.421]         class Movie(TypedDict):
       [2022/03/31 07:44:17.421]     NameError: name 'TypedDict' is not defined
       [2022/03/31 07:44:17.423] **********************************************************************
       [2022/03/31 07:44:17.423] File "examples/type_hints.rst", line 126, in default
       [2022/03/31 07:44:17.423] Failed example:
       [2022/03/31 07:44:17.423]     db: Database[Movie] = client.test
       [2022/03/31 07:44:17.423] Exception raised:
       [2022/03/31 07:44:17.423]     Traceback (most recent call last):
       [2022/03/31 07:44:17.423]       File "/opt/python/3.6/lib/python3.6/doctest.py", line 1330, in __run
       [2022/03/31 07:44:17.423]         compileflags, 1), test.globs)
       [2022/03/31 07:44:17.423]       File "<doctest default[4]>", line 1, in <module>
       [2022/03/31 07:44:17.423]         db: Database[Movie] = client.test
       [2022/03/31 07:44:17.423]     NameError: name 'Database' is not defined
       [2022/03/31 07:44:17.433] **********************************************************************
      

      https://evergreen.mongodb.com/task/mongo_python_driver_tests_doctests__platform~ubuntu_18.04_python_version~3.6_doctests_484058e18d95793a95d3d7ad5a4e7f7e3f6161d9_22_03_31_04_50_22

            Assignee:
            steve.silvester@mongodb.com Steve Silvester
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: