)]}'
{
  "commit": "dcbd26e88dbb21e59bae0622194813af1d9ccade",
  "tree": "311d31aa0237187a8abd7f0aa278989751f0255b",
  "parents": [
    "a426453da88f026b0b362a516b0c4b61f53bb2b1"
  ],
  "author": {
    "name": "Tobias Fuchs",
    "email": "fuchs@roofline.ai",
    "time": "Thu Dec 03 11:15:20 2026 +0100"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Thu Dec 03 11:15:20 2026 +0100"
  },
  "message": "[Core] Python tests in pytest (#25345)\n\n## Why\n\nIREE\u0027s Python tests run as scripts that end in `unittest.main()`, so\nevery test has to be a `unittest.TestCase`. Future tests may be plain\ntest functions, fixtures, with parametrization. pytest also runs\n`unittest` classes, so making it the runner keeps all existing tests\nworking without changes.\n\n## Change\n\n- CMake: `iree_py_test` and `iree_local_py_test` run `python -m pytest\n\u003cfile\u003e`, and `ARGS` go to pytest. The new `SCRIPT` option keeps running\na file as a script, for samples and for files that pytest cannot run. 27\nof the 50 registered tests now run under pytest; 23 stay scripts\n- CMake passes `--log-level\u003dDEBUG`, so a failed test still shows what it\nlogged\n- Bazel: an `iree_py_test` macro that runs pytest, used by the tests of\n`iree.core`, the profile renderer and two build scripts. pytest is added\nto the Bazel pip lock\n- pkgci runs the `iree.core` tests and the ONNX import test with pytest\n- pytest is added to\n`runtime/bindings/python/iree/runtime/build_requirements.txt`\n- `pytest.ini` at the repository root, so that pytest doesn\u0027t use the\nconfiguration of a project that contains IREE\n- Four tests that relied on running as `__main__` now work under any\nrunner: `basic_test` and `net_test` of `iree.build`, `import_onnx_test`\nand `mnist_builder_test`\n- The testing guide gets a section on Python tests\n\n---------\n\nSigned-off-by: Tobias Fuchs \u003cfuchs@roofline.ai\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "eb0e281d25262731b46ee28df4ed3fc4bd8d973f",
      "old_mode": 33188,
      "old_path": ".github/workflows/pkgci_unit_test.yml",
      "new_id": "00d21972a1954ca35e89cce70ea2eeb4be26a61d",
      "new_mode": 33188,
      "new_path": ".github/workflows/pkgci_unit_test.yml"
    },
    {
      "type": "modify",
      "old_id": "f0d01e6692d52b575ee079a453f3c99e6ce5f29e",
      "old_mode": 33188,
      "old_path": ".gitignore",
      "new_id": "0b7612816e7ab8d155feb71238865f9eec428cad",
      "new_mode": 33188,
      "new_path": ".gitignore"
    },
    {
      "type": "modify",
      "old_id": "7ad5e2f5436227c8ade193bf9a1f20c251b99161",
      "old_mode": 33188,
      "old_path": "build_tools/bazel/BUILD.bazel",
      "new_id": "8c0fff67752548e78f67e17bb8f91613196bcec7",
      "new_mode": 33188,
      "new_path": "build_tools/bazel/BUILD.bazel"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "16284003db83dddf86c09ceb78d9813532433d07",
      "new_mode": 33188,
      "new_path": "build_tools/bazel/iree_py_test.bzl"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "cb2d40db6439eda10c3d622c664aa4414fdee5f5",
      "new_mode": 33188,
      "new_path": "build_tools/bazel/pytest_main.py"
    },
    {
      "type": "modify",
      "old_id": "8b4661f6308ffd9f9ee9910b890c4af4827885ff",
      "old_mode": 33188,
      "old_path": "build_tools/bazel/requirements.in",
      "new_id": "90a0702460ff4cc4f6dedde1551ff58f27092689",
      "new_mode": 33188,
      "new_path": "build_tools/bazel/requirements.in"
    },
    {
      "type": "modify",
      "old_id": "c64566df9f3ed102c41fbf7d7f8d184f8260a92f",
      "old_mode": 33188,
      "old_path": "build_tools/bazel/requirements.txt",
      "new_id": "ab2e5bdc73eabb861607ddda07678864eeef882b",
      "new_mode": 33188,
      "new_path": "build_tools/bazel/requirements.txt"
    },
    {
      "type": "modify",
      "old_id": "6b91438b24be9caf97b89622396512efa3b5d28a",
      "old_mode": 33188,
      "old_path": "build_tools/bazel_to_cmake/bazel_to_cmake_converter.py",
      "new_id": "9c53e88bddf73019e3b2bc56fcee1c057e3cd7fd",
      "new_mode": 33188,
      "new_path": "build_tools/bazel_to_cmake/bazel_to_cmake_converter.py"
    },
    {
      "type": "modify",
      "old_id": "abec00964f5c2d76360263f8cfc2ff1748cd69db",
      "old_mode": 33188,
      "old_path": "build_tools/cmake/iree_python.cmake",
      "new_id": "3d351deb00e065610e3d9ccf714ef7f055381ba7",
      "new_mode": 33188,
      "new_path": "build_tools/cmake/iree_python.cmake"
    },
    {
      "type": "modify",
      "old_id": "a25500bcf4f6b6e7332beab6f7876bd1da7e18d5",
      "old_mode": 33188,
      "old_path": "build_tools/scripts/BUILD.bazel",
      "new_id": "a605ea5b4aff05d8024edb1111739b8efaefadbd",
      "new_mode": 33188,
      "new_path": "build_tools/scripts/BUILD.bazel"
    },
    {
      "type": "modify",
      "old_id": "b07215f8db600f61dbcc1122151bda0a55eda98e",
      "old_mode": 33188,
      "old_path": "compiler/bindings/python/test/api/CMakeLists.txt",
      "new_id": "be8310c8e4e0b460bf10476a312b3792e3a7a65c",
      "new_mode": 33188,
      "new_path": "compiler/bindings/python/test/api/CMakeLists.txt"
    },
    {
      "type": "modify",
      "old_id": "e70f841c835bcdd131a450d74e5f611f168c19cf",
      "old_mode": 33188,
      "old_path": "compiler/bindings/python/test/build_api/basic_test.py",
      "new_id": "68f9a86169e5c89789c04a847be7b42c47323924",
      "new_mode": 33188,
      "new_path": "compiler/bindings/python/test/build_api/basic_test.py"
    },
    {
      "type": "modify",
      "old_id": "60f750c6bd30e9a9a8f07fd553118b6296b735d5",
      "old_mode": 33188,
      "old_path": "compiler/bindings/python/test/build_api/mnist_builder_test.py",
      "new_id": "302c944e833ef4cd2dd9699bd4180e7c9b87acd4",
      "new_mode": 33188,
      "new_path": "compiler/bindings/python/test/build_api/mnist_builder_test.py"
    },
    {
      "type": "modify",
      "old_id": "8899065be1ff471e1a573aca41b59891668eda91",
      "old_mode": 33188,
      "old_path": "compiler/bindings/python/test/build_api/net_test.py",
      "new_id": "c7c1d796b23d25c073c2dd584c4d62a259c9a443",
      "new_mode": 33188,
      "new_path": "compiler/bindings/python/test/build_api/net_test.py"
    },
    {
      "type": "modify",
      "old_id": "18469dd59d7a8cbedf15db89195a5dd494b0050b",
      "old_mode": 33188,
      "old_path": "compiler/bindings/python/test/extras/CMakeLists.txt",
      "new_id": "2387e5c4b28b567012da534c6d04239f1f04b80e",
      "new_mode": 33188,
      "new_path": "compiler/bindings/python/test/extras/CMakeLists.txt"
    },
    {
      "type": "modify",
      "old_id": "fcf7b13359cb00ccf52c76f80cd782c0c95b11a1",
      "old_mode": 33188,
      "old_path": "compiler/bindings/python/test/ir/CMakeLists.txt",
      "new_id": "efdca6f729295862472e456c4760a19223f136d8",
      "new_mode": 33188,
      "new_path": "compiler/bindings/python/test/ir/CMakeLists.txt"
    },
    {
      "type": "modify",
      "old_id": "ec96eeabf64f2ff54cda3f05d6d3f1ac39b47416",
      "old_mode": 33188,
      "old_path": "compiler/bindings/python/test/tools/CMakeLists.txt",
      "new_id": "59ac742676f80fb73e3eb973291f259ff680ec2a",
      "new_mode": 33188,
      "new_path": "compiler/bindings/python/test/tools/CMakeLists.txt"
    },
    {
      "type": "modify",
      "old_id": "0692e4cf7d7da0d76bec61eff17f96994902c5c2",
      "old_mode": 33188,
      "old_path": "compiler/bindings/python/test/tools/import_onnx_test.py",
      "new_id": "72a00451b48f38d71917c9e7b30a48350c03419d",
      "new_mode": 33188,
      "new_path": "compiler/bindings/python/test/tools/import_onnx_test.py"
    },
    {
      "type": "modify",
      "old_id": "1011de3aa7990867e8677ca813354f49babd8402",
      "old_mode": 33188,
      "old_path": "core/python/BUILD.bazel",
      "new_id": "5cce0dc1f351a07d85b2e4293d38490177e77891",
      "new_mode": 33188,
      "new_path": "core/python/BUILD.bazel"
    },
    {
      "type": "modify",
      "old_id": "9fbaf9f4644c68dd12db6cb57ddf84a192709919",
      "old_mode": 33188,
      "old_path": "core/python/README.md",
      "new_id": "045186d8fe32f076600421b080440fb199a4791e",
      "new_mode": 33188,
      "new_path": "core/python/README.md"
    },
    {
      "type": "modify",
      "old_id": "2beff16f02b638d0f52eeee27925ccc4c2b1d88a",
      "old_mode": 33188,
      "old_path": "docs/website/docs/developers/general/testing-guide.md",
      "new_id": "13a2086d90c103934715a0235a5f58a82f2be6eb",
      "new_mode": 33188,
      "new_path": "docs/website/docs/developers/general/testing-guide.md"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "cb65491c0f8a2f109215aacff5153230e2f2b8ce",
      "new_mode": 33188,
      "new_path": "pytest.ini"
    },
    {
      "type": "modify",
      "old_id": "81384ac316e4ffe5c06d4c009f7a26e61a364e37",
      "old_mode": 33188,
      "old_path": "runtime/bindings/python/iree/runtime/build_requirements.txt",
      "new_id": "f056495f876cdde9f07e2bb43793a7c431728543",
      "new_mode": 33188,
      "new_path": "runtime/bindings/python/iree/runtime/build_requirements.txt"
    },
    {
      "type": "modify",
      "old_id": "aeb571f87ab2d66a1bec0ee716639775daa11310",
      "old_mode": 33188,
      "old_path": "runtime/src/iree/tooling/profile/BUILD.bazel",
      "new_id": "51469ac3688587a52946bc90f5238b90dd19b57b",
      "new_mode": 33188,
      "new_path": "runtime/src/iree/tooling/profile/BUILD.bazel"
    },
    {
      "type": "modify",
      "old_id": "fc72cb88c4845ed100714ecff8c36e345dc9e1ea",
      "old_mode": 33188,
      "old_path": "runtime/src/iree/tooling/profile/CMakeLists.txt",
      "new_id": "0703e115d4cbdde7c8265820a7a8ea784a3a7039",
      "new_mode": 33188,
      "new_path": "runtime/src/iree/tooling/profile/CMakeLists.txt"
    },
    {
      "type": "modify",
      "old_id": "85c82bc9c5664a18a1697ad049043d8d66d7ce09",
      "old_mode": 33188,
      "old_path": "samples/py_custom_module/CMakeLists.txt",
      "new_id": "282129a8c465f79fb57c9f0fac2e7147222a5acf",
      "new_mode": 33188,
      "new_path": "samples/py_custom_module/CMakeLists.txt"
    },
    {
      "type": "modify",
      "old_id": "1a5957b2fefcbe90263c95c3fca5343d1a836104",
      "old_mode": 33188,
      "old_path": "samples/sink_callback/CMakeLists.txt",
      "new_id": "bcd53678d316cc155134bbb80d3d227a9f423d5d",
      "new_mode": 33188,
      "new_path": "samples/sink_callback/CMakeLists.txt"
    },
    {
      "type": "modify",
      "old_id": "863da9f18ca4eb593f667f9ac3e56f7e986ef93a",
      "old_mode": 33188,
      "old_path": "tests/e2e/collectives/CMakeLists.txt",
      "new_id": "387f668a52621bb2c96e4b0019e368c00c1e500b",
      "new_mode": 33188,
      "new_path": "tests/e2e/collectives/CMakeLists.txt"
    },
    {
      "type": "modify",
      "old_id": "f362a3e1e2d653c2e59e3d433ac0a7c8cc834610",
      "old_mode": 33188,
      "old_path": "tests/e2e/stablehlo_models/mnist_train_test/CMakeLists.txt",
      "new_id": "17be48eac7e20e9b4a5533eb67d0bff31f86a1f2",
      "new_mode": 33188,
      "new_path": "tests/e2e/stablehlo_models/mnist_train_test/CMakeLists.txt"
    }
  ]
}
