Sym two by etiennerichart · Pull Request #814 · bpython/bpython
This fails for me locally now, but it looks close. If I sort both lists and print them, I get
actual: ['Left', 'Level0', 'Level0.Level1', 'Level0.Level1.Level2', 'Level0.Level1.Level2.Level3', 'Right', 'Right.toLeft', 'Right.toLeft.toRight']
expected: ['Left', 'Left.toRight', 'Left.toRight.toLeft', 'Level0', 'Level0.Level1', 'Level0.Level1.Level2', 'Level0.Level1.Level2.Level3', 'Right']
Is this passing for you?
It occurs to me that this could be nondeterministic since a given module can be referred to mulitple ways based on which filepath got our import discoverer there first, say if os.listdir() returned files in a different order we could end up with different names for the same modules. If this isn't passing for you yet either then we may not need to do this, but if it is and this is something nondeterministic we want to control we could sort the results of os.listdir() in the import completion code to ensure the same results each time.