1
0
python-networkx/numpy-38-test.patch
Steve Kowalik 93aa5ab2bb - Update to version 2.4
Highlights:
  * Remove deprecated code from 1.x
  * Support for Python 3.8
  * Switched to pytest for testing
  * Last release to support Python 3.5
  * Fifteen new fuctions, including onion decomposition and linear prufing
  * Three new generators, such as a directed joint degree generator
- Add numpy-38-test.patch, to correct test failure under Python 3.8  
- Update URL, upstream changed to tarballs from zipfiles.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-networkx?expand=0&rev=13
2019-11-17 23:57:47 +00:00

70 lines
2.6 KiB
Diff

diff --git a/networkx/readwrite/tests/test_gexf.py b/networkx/readwrite/tests/test_gexf.py
index afc40111..f16504c0 100644
--- a/networkx/readwrite/tests/test_gexf.py
+++ b/networkx/readwrite/tests/test_gexf.py
@@ -404,7 +404,8 @@ gexf.net/1.2draft http://www.gexf.net/1.2draft/gexf.xsd" version="1.2">
nx.set_node_attributes(G, {n: n for n in numpy.arange(4)}, 'number')
G[0][1]['edge-number'] = numpy.float64(1.1)
- expected = """<gexf version="1.2" xmlns="http://www.gexf.net/1.2draft"\
+ if sys.version_info < (3, 8):
+ expected = """<gexf version="1.2" xmlns="http://www.gexf.net/1.2draft"\
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation\
="http://www.gexf.net/1.2draft http://www.gexf.net/1.2draft/gexf.xsd">
<meta lastmodifieddate="{}">
@@ -449,6 +450,54 @@ gexf.net/1.2draft http://www.gexf.net/1.2draft/gexf.xsd" version="1.2">
<edge id="2" source="2" target="3" />
</edges>
</graph>
+</gexf>""".format(time.strftime('%Y-%m-%d'), nx.__version__)
+ else:
+ expected = """<gexf xmlns="http://www.gexf.net/1.2draft"\
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation\
+="http://www.gexf.net/1.2draft http://www.gexf.net/1.2draft/gexf.xsd"\
+ version="1.2">
+ <meta lastmodifieddate="{}">
+ <creator>NetworkX {}</creator>
+ </meta>
+ <graph defaultedgetype="undirected" mode="static" name="">
+ <attributes mode="static" class="edge">
+ <attribute id="1" title="edge-number" type="float" />
+ </attributes>
+ <attributes mode="static" class="node">
+ <attribute id="0" title="number" type="int" />
+ </attributes>
+ <nodes>
+ <node id="0" label="0">
+ <attvalues>
+ <attvalue for="0" value="0" />
+ </attvalues>
+ </node>
+ <node id="1" label="1">
+ <attvalues>
+ <attvalue for="0" value="1" />
+ </attvalues>
+ </node>
+ <node id="2" label="2">
+ <attvalues>
+ <attvalue for="0" value="2" />
+ </attvalues>
+ </node>
+ <node id="3" label="3">
+ <attvalues>
+ <attvalue for="0" value="3" />
+ </attvalues>
+ </node>
+ </nodes>
+ <edges>
+ <edge source="0" target="1" id="0">
+ <attvalues>
+ <attvalue for="1" value="1.1" />
+ </attvalues>
+ </edge>
+ <edge source="1" target="2" id="1" />
+ <edge source="2" target="3" id="2" />
+ </edges>
+ </graph>
</gexf>""".format(time.strftime('%Y-%m-%d'), nx.__version__)
obtained = '\n'.join(nx.generate_gexf(G))
assert expected == obtained