From 906efeec0a471be522588bd7cbb7f61459b2b437 Mon Sep 17 00:00:00 2001 From: Alex Zinenko Date: Thu, 7 Jan 2021 11:29:17 +0100 Subject: [PATCH] [mlir] don't match the text produced only in debug mode in Python tests Some Python bindings tests were using FileCheck to match parts of the error description produced only in the debug compilation mode. Remove these parts (but keep the main message) to ensure tests also pass when running them in the release compilation mode. Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D94221 --- mlir/test/Bindings/Python/ir_attributes.py | 2 +- mlir/test/Bindings/Python/ir_operation.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mlir/test/Bindings/Python/ir_attributes.py b/mlir/test/Bindings/Python/ir_attributes.py index ce85dc3..91b0a92 100644 --- a/mlir/test/Bindings/Python/ir_attributes.py +++ b/mlir/test/Bindings/Python/ir_attributes.py @@ -371,7 +371,7 @@ def testArrayAttr(): try: ArrayAttr.get([42]) except RuntimeError as e: - # CHECK: Error: Invalid attribute when attempting to create an ArrayAttribute (Unable to cast Python instance of type to C++ type 'mlir::python::PyAttribute') + # CHECK: Error: Invalid attribute when attempting to create an ArrayAttribute print("Error: ", e) run(testArrayAttr) diff --git a/mlir/test/Bindings/Python/ir_operation.py b/mlir/test/Bindings/Python/ir_operation.py index ba54e83..034b28e 100644 --- a/mlir/test/Bindings/Python/ir_operation.py +++ b/mlir/test/Bindings/Python/ir_operation.py @@ -566,17 +566,17 @@ def testCreateWithInvalidAttributes(): try: Operation.create("module", attributes={None:StringAttr.get("name")}) except Exception as e: - # CHECK: Invalid attribute key (not a string) when attempting to create the operation "module" (Unable to cast Python instance of type to C++ type + # CHECK: Invalid attribute key (not a string) when attempting to create the operation "module" print(e) try: Operation.create("module", attributes={42:StringAttr.get("name")}) except Exception as e: - # CHECK: Invalid attribute key (not a string) when attempting to create the operation "module" (Unable to cast Python instance of type to C++ type + # CHECK: Invalid attribute key (not a string) when attempting to create the operation "module" print(e) try: Operation.create("module", attributes={"some_key":ctx}) except Exception as e: - # CHECK: Invalid attribute value for the key "some_key" when attempting to create the operation "module" (Unable to cast Python instance of type to C++ type 'mlir::python::PyAttribute') + # CHECK: Invalid attribute value for the key "some_key" when attempting to create the operation "module" print(e) try: Operation.create("module", attributes={"some_key":None}) -- 2.7.4