Skip to content

Commit

Permalink
Output graph edges in deterministic order
Browse files Browse the repository at this point in the history
Makes the tests reliable.
  • Loading branch information
mgedmin committed Feb 1, 2014
1 parent 2ccded1 commit b9e57c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions findimports.py
Expand Up @@ -723,11 +723,11 @@ def printDot(self):
for n, name in enumerate(extNames):
nameDict[name] = id = "extmod%d" % n
print " %s[label=\"%s\"];" % (id, name)
for module in self.modules.values():
for modname, module in sorted(self.modules.items()):
for other in module.imports:
if other in nameDict:
print " %s -> %s;" % (nameDict[module.modname],
nameDict[other]);
nameDict[other])
print "}"


Expand Down
8 changes: 4 additions & 4 deletions tests/graphviz.txt
Expand Up @@ -17,10 +17,10 @@ graphviz
extmod0[label="gc"];
extmod1[label="os"];
extmod2[label="sys"];
mod4 -> extmod0;
mod2 -> mod3;
mod2 -> extmod0;
mod0 -> extmod2;
mod0 -> extmod1;
mod0 -> extmod2;
mod2 -> extmod0;
mod2 -> mod3;
mod4 -> extmod0;
}

0 comments on commit b9e57c8

Please sign in to comment.