"Expressions with symbols in the list .... cannot be used in tests"

My experiment using Mathematica’s Testing Notebooks has proven useful to detect code ripples much earlier … except for the dreaded “Expressions with symbols in the list … cannot be used in tests” when I click “Run All” as opposed to evaluating the whole notebook.

Per the attached image, I have no idea which Input/Expected Output Cell is causing the problem. Enabling Mathematica’s Debugger to break on all Messages doesn’t identify the problem cell either. Manually, I have searched all Input and Expected Output pairs for the source but I’m not “seeing” it.

Two questions :

  1. Is there a better unit-testing framework coding strategy I should employ to rapidly detect when upstream data structure changes have adverse effects downstream?
  2. Any harm in my forgoing the use of “Run All” and instead, manually “Select All” cells to evaluate the notebook and all its tests?

I think there is some missing context. The picture you posted doesn’t look like standard Mathematica system messages. It looks like a bespoke dialog. Is that something you built? Is it part of a framework/package you’re using? Also, I know you probably don’t want to upload your entire notebook here, but without some sample code that re-produces the error, it’s going to be very difficult for anyone to help you.

Mathematica’s Unit Testing Framework generates that dialog when I click the framework’s “Run All” button.

Oh cool. I’ve never used that before.

Okay, now, why don’t you just run each input cell in sequence until the dialog gets generated?

Or alternatively, the dialog tells you which forms/expressions are disallowed (*Form), so just do a search for where symbols like *Form are being used.

When I run the input cells in sequence, none generate the dialog. When I select all cells in the entire notebook and execute them, the dialog does not appear then either. Its only when I click the “Run All” button.