Better test assertions for error substrings

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • Python Drivers
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      Context

      In multiple cases, our test assertions use `assertTrue` to check that error messages contain a specified substring. This pattern provides no useful information in the case of failures, such as https://evergreen.mongodb.com/test_log/mongo_python_driver_test_win64_python3.9_test_4.4_sharded_cluster_auth_ssl_async_patch_e724d66bb524052684c107db736d2b74e4098d66_67ec4837b7b1b30007e48bc4_25_04_01_20_10_36/0?test_name=10d7ac607ed7212241e3629a75078c78#L0.

      Definition of done

      Use `assertIn` instead to give informational failure messages.

      Pitfalls

      N/A

            Assignee:
            Noah Stapp
            Reporter:
            Noah Stapp
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: