Sym two#814
Conversation
thomasballinger
left a comment
There was a problem hiding this comment.
Thanks for exploring a few options here, I think I like this last one best.
Sorry, something went wrong.
|
@thomasballinger I am trying to write the test file but am having an issue with the |
Sorry, something went wrong.
thomasballinger
left a comment
There was a problem hiding this comment.
See the docs for tempfile.TemporaryDirectory - the files in the temp directory will be erased along with the directory after exiting the context manager.
Sorry, something went wrong.
|
I have almost finished turning the test class into a test file but for some reason the test is passing when it should not. In the temp directory setup I have it print out what should appear and in what order and the 'Left' file is first. In the actual test 'Left' is last and yet the test still passes. |
Sorry, something went wrong.
|
I have made the changes so that importtest now works. While I was debugging I used the nosetests -s command and it seems that the temp directory is showing up in (I bolded what I think is the temp dir), '..SS.S...........S..S.......................S...SSSSS......................................................tmpfaxxkuhx |
Sorry, something went wrong.
|
Please move the test file to |
Sorry, something went wrong.
sebastinas
left a comment
There was a problem hiding this comment.
Sorry, I've some more comments that I missed earlier.
Sorry, something went wrong.
|
Now when I run this test after commenting out your fix, it still passes; so I'm worried this isn't testing what we think it is. One problem I see is that sometimes you're using the string 'import_test_folder' when there's no folder that exists with that name. When I run your setup function (and then pause in it so I have time to examine the files) I see that the temporary directory is named |
Sorry, something went wrong.
|
This fails for me locally now, but it looks close. If I sort both lists and print them, I get 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 |
Sorry, something went wrong.
|
I think that the problem is that when going between left and right it went right first whereas on my computer it went left first |
Sorry, something went wrong.
|
Got it, I think we want to change the implementation then to sort. I think wrapping the |
Sorry, something went wrong.
|
This alternative approach works for me, import completion will traverse the filesystem in the nondeterministic order determined by os.listdir() but both orders work in the test. @sebastinas thoughts? |
Sorry, something went wrong.
sebastinas
left a comment
There was a problem hiding this comment.
Looks good to me, but please squash the commits when merging the changes.
Sorry, something went wrong.
Use os.path.realpath to see the source of symbolic links and makes sure that we are not in a loop. Also include importtest.py and importtestfolder to test if program gets stuck in a loop.
Resolves #806