# op.run_must_fail · Rell standard library · Chromia Docs (concept)

> function run_ must_ fail(): failure Assert that this test operation call fails. More precisely: Build a test block containing a single test transaction, wh

Source: https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/rell.test/op/run_must_fail/

FUNCTION

# op.run\_must\_fail

```signature
function run_must_fail(): failure
```

Assert that this test operation call fails.

More precisely:

1. Build a test block containing a single test transaction, which contains only this test
   operation call.
2. Assert that the building fails (i.e. that invoking this test transaction
   call results in a thrown exception).

Since 0.10.4

---

```signature
function run_must_fail(expected_message: text): failure
```

Assert that this test operation call fails.

More precisely:

1. Build a test block containing a single test transaction, which contains only this test
   operation call.
2. Assert that the building fails (i.e. that invoking this test transaction
   call results in a thrown exception).

Checks that the given message is a substring of the thrown message. For example
`my_tx.run_must_fail('out of bounds')` succeeds if an exception with message
`Run-time error: List index out of bounds: 0 (size 0)` is thrown.

**Parameters**

* **expected\_message** — the expected substring of the error message

Since 0.11.0

[View this page on docs.chromia.com](https://docs.chromia.com/pages/rell-stdlib/-rell%20-system%20-library/rell.test/op/run_must_fail.html)Generated API reference, mirrored from the live docs
