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

Test Failure - doctests NameError: name 'timezone' is not defined

    • Type: Icon: Build Failure Build Failure
    • Resolution: Duplicate
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      doctests (python setup.py doc -t) are failing, caused by PYTHON-3702

      54] 1 items passed all tests:
       [2023/06/16 15:34:37.254]   41 tests in default
       [2023/06/16 15:34:37.254] 41 tests in 1 items.
       [2023/06/16 15:34:37.254] 41 passed and 0 failed.
       [2023/06/16 15:34:37.254] Test passed.
       [2023/06/16 15:34:37.281] Document: tutorial
       [2023/06/16 15:34:37.281] ------------------
       [2023/06/16 15:34:37.281] **********************************************************************
       [2023/06/16 15:34:37.281] File "tutorial.rst", line 106, in default
       [2023/06/16 15:34:37.281] Failed example:
       [2023/06/16 15:34:37.281]     post = {
       [2023/06/16 15:34:37.281]         "author": "Mike",
       [2023/06/16 15:34:37.281]         "text": "My first blog post!",
       [2023/06/16 15:34:37.281]         "tags": ["mongodb", "python", "pymongo"],
       [2023/06/16 15:34:37.281]         "date": datetime.datetime.now(tz=timezone.utc),
       [2023/06/16 15:34:37.281]     }
       [2023/06/16 15:34:37.281] Exception raised:
       [2023/06/16 15:34:37.281]     Traceback (most recent call last):
       [2023/06/16 15:34:37.281]       File "/opt/python/3.8/lib/python3.8/doctest.py", line 1336, in __run
       [2023/06/16 15:34:37.281]         exec(compile(example.source, filename, "single",
       [2023/06/16 15:34:37.281]       File "<doctest default[1]>", line 5, in <module>
       [2023/06/16 15:34:37.281]         "date": datetime.datetime.now(tz=timezone.utc),
       [2023/06/16 15:34:37.281]     NameError: name 'timezone' is not defined
      

      https://evergreen.mongodb.com/task/mongo_python_driver_tests_doctests__platform~rhel84_python_version~3.8_doctests_601d1ec3a13434761bfd9997cc8ee6633c3d9f93_23_06_15_19_54_29

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

              Created:
              Updated:
              Resolved: