Skip to content

Commit

Permalink
Clean up doctest temporary example files.
Browse files Browse the repository at this point in the history
Update .hgignore to include version.py and build directory.
Fixes networkx#433
  • Loading branch information
hagberg committed Sep 20, 2010
1 parent 89d1b43 commit 40a1baa
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .hgignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
syntax: glob
*.pyc
*~
build/*
networkx/version.py
5 changes: 5 additions & 0 deletions networkx/readwrite/adjlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
10 changes: 9 additions & 1 deletion networkx/readwrite/edgelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------
Expand Down Expand Up @@ -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')
6 changes: 6 additions & 0 deletions networkx/readwrite/gml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
5 changes: 5 additions & 0 deletions networkx/readwrite/gpickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
5 changes: 5 additions & 0 deletions networkx/readwrite/graphml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
5 changes: 5 additions & 0 deletions networkx/readwrite/multiline_adjlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
5 changes: 5 additions & 0 deletions networkx/readwrite/nx_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
5 changes: 5 additions & 0 deletions networkx/readwrite/pajek.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

0 comments on commit 40a1baa

Please sign in to comment.