Your approach seems wonderful to me.
Generally speaking, I do not think that there is something like a “standard way” for the selective execution of unit tests based on the iOS version.
On the one hand, your approach is the same that can be used to implement one function selectively or differently according to the version of iOS. You may already know about this discussion at CocoaWithLove: Tips and tricks from the conditional .... This is pretty old, but the approaches described here remain.
You won’t indicate how your unit tests are performed, but the real cool way to handle this, IMO, would be to determine which tests to run outside of the implementation so that you specify which ones are for iOS7 and not pollute your test implementation.
This can be done, for example, through the version number associated with each test; Before calling the unit test implementation, you check the version number in the function call, for example, testSomethingThatOnlyWorksOniOS7 .
EDIT:
In fact, everything can be simpler than I thought in the first place. Now I’ve hacked a bit ...
You can change the place in OCUnit where the actual test method call is made (I don’t know about this, sorry, but I don’t think it should be hard to find ...) so that it checks the selector name: you convert the selector name to a string ( NSStringFromSelector ), and if it matches some regular expression, you take some specific branch (which will simply be in your case, ignoring this test).
If you are concerned about changing OCUnit, which might be unreasonable, what I said above could be done using the swizzling method: only if the selector name does not match your expression, you call the original implementation, otherwise you do nothing.