-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PR: Fix error when setting a path with a single quote #6543
Conversation
@csabella, please add a test for this. |
@ccordoba12 I wasn't sure how to add a test. I put some code on the issue showing that it was working with a manual test. Is there an existing test that I can look at for creating a new directory or for working with these ipython command calls? |
Take a look at That does pretty much what you need to do here. |
Hello @csabella! Thanks for updating the PR. Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated on March 07, 2018 at 10:50 Hours UTC |
@ccordoba12 Thanks for the suggestion! In that test file, I'm getting PEP8 warnings, but I copied that code from the other tests. Is the longer line allowed here? |
@@ -323,6 +323,60 @@ def test_console_coloring(ipyconsole, qtbot): | |||
assert console_font_color.strip() == editor_font_color.strip() | |||
|
|||
|
|||
@pytest.mark.slow | |||
@flaky(max_runs=3) | |||
@pytest.mark.skipif(os.name == 'nt', reason="It times out sometimes on Windows") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this skipif condition to test this on Windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
# Issue 6451. | ||
savetemp = shell._cwd | ||
tempdir = tempfile.mkdtemp(suffix="queen's") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the tmpdir
fixture instead of tempfile
. There's an example of it here:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I've made the change.
|
||
@pytest.mark.slow | ||
@flaky(max_runs=3) | ||
@pytest.mark.skipif(os.name == 'nt', reason="It times out sometimes on Windows") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove skipif
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
||
# Issue 6451. | ||
savetemp = shell._cwd | ||
tempdir = tempfile.mkdtemp(suffix="queen's") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the tmpdir
fixture.
@csabella, this looks pretty good. I just left a couple of comments in your tests to improve them a bit. And please don't worry about pep8 issues in test files. Unfortunately, we can't make pep8speaks to ignore them. |
|
||
# Assert we get the assigned value correctly | ||
assert shell.get_value('cwd') == tempdir | ||
os.rmdir(tempdir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this so that this test can pass on Windows.
It looks like windows isn't applying the |
# Ask for directory. | ||
with qtbot.waitSignal(shell.sig_change_cwd): | ||
shell.get_cwd() | ||
assert shell._cwd == tempdir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if you introduce a qtbot.wait(1000)
before this line to see if the test pass?
Ignore this. I didn't see the changes you did on the tests before I wrote my comment. I've added a |
@csabella, I don't want to put an additional burden on you, so if you want to skip this test on Windows, please do it.
Well, I just removed a lot of those skipif's because I noticed the corresponding tests were hanging on Windows due to us opening a QDialog and trying to close it with a QTimer. I removed that and used a lower level API instead. |
@ccordoba12 It's not a burden. I just don't know what to change to get it to work. My dev box is Linux and it works there. I can run the Spyder installation on Windows, but I can't download the git repo and test it from there. So, I'm kind of in the dark trying to fix this in the tests. :-( |
@csabella, no worries then. If you tested your PR on a Windows box and it works, then please skip the test. You can come back later to remove the skip if you find how to do it (I've done that a lot of times :-). |
@ccordoba12 No, I haven't tested it on Windows. I can't install the git repo on the Windows box that I can access, so I can't test my changes there. |
The test is failing because of the Running this instead with a raw string works: So, following what is done in
|
Thank you, @jnsebgosselin! I really appreciate you looking into this. Without being able to test on Windows, I would have never figured that out. |
I'm glad I could help! Is it me or the tests are failing for a reason that is unrelated to this PR? The test |
Cheryl, the failures are unrelated to your tests. I'm fixing them in #6626. |
@ccordoba12 Thank you for letting me know. I was just going to start looking into them. |
@csabella, please rebase to get my fix. Then this should be ready. |
Thanks again @ccordoba12 and @jnsebgosselin for helping me get the test to pass. :-) |
Fixes #6451.