scala - Scalatest assume database is available in each test -


many of tests dependent on database. use following check connection before running test case:

assume(database.isavailable, "database down") 

when add each test case, correct !!! canceled !!! correct message displayed in output.

when add beforeeach method:

override def beforeeach() = {   assume(database.isavailable, "database down") } 

all can see exception encountered when attempting run suite class name , *** aborted *** (on line assume call).

do need add assumption each testcase?

apparently intended. see

http://www.scalatest.org/user_guide/sharing_fixtures

mix in before-and-after trait when want aborted suite, not failed test, if fixture code fails.

on same page there other alternatives. possibly worths withfixture


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -