Allow tests to skip if networkx is not available