Thanks to visit codestin.com
Credit goes to github.com

Skip to content

New USD tests fail on Python 3.11 due to changed annotations #3384

@dgovil

Description

@dgovil

Description of Issue

We are noticing an issue with running some of the embedded Boost python tests when building USD for Python 3.11 (pxr/external/boost/python/test). These tests utilize doctest which executes a documentation block and compares the script output directly. Unfortunately, the output is not consistent between Python versions, so some of the tests fail on Python 3.11 (presumably the expected output was generated with 3.10 where we are seeing the tests pass).
Here is an example test that is failing:
https://github.com/PixarAnimationStudios/OpenUSD/blob/release/pxr/external/boost/python/test/properties.py

Failed example:
    x1.value_r = 2
Expected:
    Traceback (most recent call last):
      File "properties.py", line 49, in ?
        x1.value_r = 2
    AttributeError: can't set attribute
Got:
    Traceback (most recent call last):
      File ".../doctest.py", line 1355, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest __main__[16]>", line 1, in <module>
        x1.value_r = 2
        ^^^^^^^^^^
    AttributeError: property of 'X' object has no setter

The three tests we are seeing fail in Python 3.11 are:

  • python_properties
  • python_pickle1
  • python_pickle4

Python 3.11 had a lot of work done to make tracebacks more friendly to devs, so the tests don't apply to it the same way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions