Only set cython/weave optimization options during testing when they are actually tested (avoids failed tests when cython/weave is not available)