Check the requirements before setUpBeforeClass()

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