From 40a1baa53181617165c911219117d161aeea36c3 Mon Sep 17 00:00:00 2001 From: Aric Hagberg Date: Mon, 20 Sep 2010 14:56:57 -0600 Subject: [PATCH] Clean up doctest temporary example files. Update .hgignore to include version.py and build directory. Fixes #433 --- .hgignore | 2 ++ networkx/readwrite/adjlist.py | 5 +++++ networkx/readwrite/edgelist.py | 10 +++++++++- networkx/readwrite/gml.py | 6 ++++++ networkx/readwrite/gpickle.py | 5 +++++ networkx/readwrite/graphml.py | 5 +++++ networkx/readwrite/multiline_adjlist.py | 5 +++++ networkx/readwrite/nx_yaml.py | 5 +++++ networkx/readwrite/pajek.py | 5 +++++ 9 files changed, 47 insertions(+), 1 deletion(-) diff --git a/.hgignore b/.hgignore index 807a7aee46f..99eb4710d6f 100644 --- a/.hgignore +++ b/.hgignore @@ -1,3 +1,5 @@ syntax: glob *.pyc *~ +build/* +networkx/version.py diff --git a/networkx/readwrite/adjlist.py b/networkx/readwrite/adjlist.py index 9712e725779..002d08714aa 100644 --- a/networkx/readwrite/adjlist.py +++ b/networkx/readwrite/adjlist.py @@ -308,3 +308,8 @@ def read_adjlist(path, comments="#", delimiter=' ', create_using=None, create_using = create_using, nodetype = nodetype) +# fixture for nose tests +def teardown_module(module): + import os + os.unlink('test.adjlist') + os.unlink('test.adjlist.gz') diff --git a/networkx/readwrite/edgelist.py b/networkx/readwrite/edgelist.py index 7482400694f..cfeaf883a19 100644 --- a/networkx/readwrite/edgelist.py +++ b/networkx/readwrite/edgelist.py @@ -378,7 +378,7 @@ def write_weighted_edgelist(G, path, comments="#", -------- >>> G=nx.Graph() >>> G.add_edge(1,2,weight=7) - >>> nx.write_weighted_edgelist(G, 'weighted.edgelist') + >>> nx.write_weighted_edgelist(G, 'test.weighted.edgelist') See Also -------- @@ -442,3 +442,11 @@ def read_weighted_edgelist(path, comments="#", delimiter=' ', data=(('weight',float),), encoding = encoding ) + + +# fixture for nose tests +def teardown_module(module): + import os + os.unlink('test.edgelist') + os.unlink('test.edgelist.gz') + os.unlink('test.weighted.edgelist') diff --git a/networkx/readwrite/gml.py b/networkx/readwrite/gml.py index 2d486da909b..e138a2c811e 100644 --- a/networkx/readwrite/gml.py +++ b/networkx/readwrite/gml.py @@ -394,3 +394,9 @@ def setup_module(module): import matplotlib.pyparsing except: raise SkipTest("pyparsing not available") + +# fixture for nose tests +def teardown_module(module): + import os + os.unlink('test.gml') + os.unlink('test.gml.gz') diff --git a/networkx/readwrite/gpickle.py b/networkx/readwrite/gpickle.py index 6b3811852b7..52ce6d395ac 100644 --- a/networkx/readwrite/gpickle.py +++ b/networkx/readwrite/gpickle.py @@ -94,3 +94,8 @@ def read_gpickle(path): """ fh=_get_fh(path,'rb') return pickle.load(fh) + +# fixture for nose tests +def teardown_module(module): + import os + os.unlink('test.gpickle') diff --git a/networkx/readwrite/graphml.py b/networkx/readwrite/graphml.py index d218d0317da..11e844c03f5 100644 --- a/networkx/readwrite/graphml.py +++ b/networkx/readwrite/graphml.py @@ -361,3 +361,8 @@ def setup_module(module): import xml.etree.cElementTree except: raise SkipTest("xml.etree.cElementTree not available") + +# fixture for nose tests +def teardown_module(module): + import os + os.unlink('test.graphml') diff --git a/networkx/readwrite/multiline_adjlist.py b/networkx/readwrite/multiline_adjlist.py index 7c56facdf62..3b3f37b9f5f 100644 --- a/networkx/readwrite/multiline_adjlist.py +++ b/networkx/readwrite/multiline_adjlist.py @@ -387,3 +387,8 @@ def read_multiline_adjlist(path, comments="#", delimiter=' ', edgetype = edgetype) +# fixture for nose tests +def teardown_module(module): + import os + os.unlink('test.adjlist') + os.unlink('test.adjlist.gz') diff --git a/networkx/readwrite/nx_yaml.py b/networkx/readwrite/nx_yaml.py index 6a282f464ff..eb645ec3be3 100644 --- a/networkx/readwrite/nx_yaml.py +++ b/networkx/readwrite/nx_yaml.py @@ -105,3 +105,8 @@ def setup_module(module): import yaml except: raise SkipTest("PyYAML not available") + +# fixture for nose tests +def teardown_module(module): + import os + os.unlink('test.yaml') diff --git a/networkx/readwrite/pajek.py b/networkx/readwrite/pajek.py index a994906d6d2..47a428e99d9 100644 --- a/networkx/readwrite/pajek.py +++ b/networkx/readwrite/pajek.py @@ -217,3 +217,8 @@ def parse_pajek(lines): # G=nx.Graph(G) return G + +# fixture for nose tests +def teardown_module(module): + import os + os.unlink('test.net')