Check the requirements before setUpBeforeClass()

This PR is just an updated version of #1086 which allows to skip test earlier if the requirements are not satisfied.