Test for older versions of networkx