Message Boards Message Boards

0
|
1824 Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

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

Posted 1 year ago

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?

Dialog generated by Mathematica's Testing Framework

POSTED BY: A. Chase Turner
4 Replies
Posted 1 year ago

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.

POSTED BY: Eric Rimbey

Mathematica's Unit Testing Framework generates that dialog when I click the framework's "Run All" button.

POSTED BY: A. Chase Turner
Posted 1 year ago

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.

POSTED BY: Eric Rimbey

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.

POSTED BY: A. Chase Turner
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract