Menu

#4 utAssert calls in setup

Closed
None
2.2
11
2015-06-30
2015-03-12
Andy
No

Is there a reason utAssert calls don't work in ut_setup? I tried adding a couple in my ut_setup procedure to ensure that setup for my test data worked as expected (I'm loading test data from a table). Didn't see any output regardless of failure or success. Not a huge issue but seems like it could be helpful.

Discussion

  • Paul Walker

    Paul Walker - 2015-03-21
    • assigned_to: Paul Walker
     
  • Paul Walker

    Paul Walker - 2015-03-21

    I'm not certain off the top of my head how the code handles calls to utAssert during setup or teardown, but in general, you wouldn't really want to do tests in these routines. The basic process flow of the xUnit frameworks is:

    • Setup
    • Test
    • Teardown

    I would say that calls to utAssert should only really happen in the testing stage.

     
  • Andy

    Andy - 2015-03-24

    Right, I agree with what you are saying. My thought was using utAssert to verify that test data was set up correctly. In our case, we have some fairly complex that is generated though a different process that ultimately adds records to several tables. If anything went wrong there I'd like to halt testing and be notified.

     
  • Paul Walker

    Paul Walker - 2015-03-26

    I suppose you could have a test that is specifically to check the data setup. The tests will run in alphabetical order, so you can control the order they run by careful naming.

     
  • Paul Walker

    Paul Walker - 2015-06-30

    No recent contact, closing ticket. Please raise a new ticket if you would like any further help

     
  • Paul Walker

    Paul Walker - 2015-06-30
    • status: Open --> Closed
     

Log in to post a comment.