-
Notifications
You must be signed in to change notification settings - Fork 85
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
Added tests for newer versions of ipython and python #44
Changes from all commits
aa551fa
40c8ab7
4960273
c7f6267
91132cf
9839eb8
29c67e5
9d5ea96
1941793
2660915
c601d26
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,7 @@ | |
) | ||
from ..utils.ipycompat import ( | ||
APITest, Config, FileContentsManager, GenericFileCheckpoints, to_os_path, | ||
) | ||
IPY3) | ||
from ..utils.sync import walk, walk_dirs | ||
|
||
|
||
|
@@ -163,6 +163,38 @@ def test_list_checkpoints_sorting(self): | |
) | ||
) | ||
|
||
# skip test as it is not satisfyable across supported notebook versions | ||
def test_delete_non_empty_dir(self): | ||
# ContentsManager has different behaviour in notebook 5.5+ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, from reading the discussion on jupyter/notebook#3108, it seems like the reason notebook now allows deleting non-empty directories is that they switched to using I think the easiest way to test that ensure that behavior is to make this method conditional on the value of Apologies for the somewhat complex feedback here: this suite is a bit convoluted, but since this is testing the code that controls whether/how we delete user data on Quantopian, I want to err on the side of caution. If you prefer, I can also open a PR against this branch with the changes I have in mind for the suite. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's probably for the best |
||
# https://github.com/jupyter/notebook/pull/3108 | ||
|
||
# Old behaviour | ||
# from notebook.tests.launchnotebook import assert_http_error | ||
|
||
if isinstance(self.notebook.contents_manager, PostgresContentsManager): | ||
_test_delete_non_empty_dir_fail(self) | ||
else: | ||
_test_delete_non_empty_dir_pass(self) | ||
|
||
|
||
def _test_delete_non_empty_dir_fail(self): | ||
if IPY3: | ||
return | ||
from notebook.tests.launchnotebook import assert_http_error | ||
with assert_http_error(400): | ||
self.api.delete(u'å b') | ||
|
||
|
||
def _test_delete_non_empty_dir_pass(self): | ||
if IPY3: | ||
return | ||
from notebook.tests.launchnotebook import assert_http_error | ||
# Test that non empty directory can be deleted | ||
self.api.delete(u'å b') | ||
# Check if directory has actually been deleted | ||
with assert_http_error(404): | ||
self.api.list(u'å b') | ||
|
||
|
||
def postgres_contents_config(): | ||
""" | ||
|
@@ -441,12 +473,12 @@ def _method(self, api_path, *args): | |
'isfile', | ||
'isdir', | ||
] | ||
l = locals() | ||
locs = locals() | ||
for method_name in __methods_to_multiplex: | ||
l[method_name] = __api_path_dispatch(method_name) | ||
locs[method_name] = __api_path_dispatch(method_name) | ||
del __methods_to_multiplex | ||
del __api_path_dispatch | ||
del l | ||
del locs | ||
|
||
# Override to not delete the root of the file subsystem. | ||
def test_delete_dirs(self): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,8 +47,9 @@ def main(): | |
install_requires=reqs, | ||
extras_require={ | ||
'test': test_reqs, | ||
'ipy3': ['ipython[test,notebook]<4.0'], | ||
'ipy4': ['ipython<6.0', 'notebook[test]>=4.0,<5.0'], | ||
'ipy3': ['ipython[test,notebook]<4.0', 'tornado<5.0'], | ||
'ipy4': ['ipython<6.0', 'notebook[test]>=4.0,<5.0', 'tornado<5.0'], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the tornado change? I wouldn't expect pgcontents to care much about the version of tornado. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pgcontents doesn't care, but notebook very much does and older versions of notebook don't pin tornado to an upper bound. tornado 5 did enough backward incompatible changes to basically make it not work unless you are running a substantially closer to master version of notebook. |
||
'ipy6': ['ipython>=6.0', 'notebook[test]>=5.0'] | ||
}, | ||
scripts=[ | ||
'bin/pgcontents', | ||
|
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.
Does IPython 6 require 3.6 or higher? My inclination would be to test on the oldest supported version of Python, since that's the most likely to surface version compatibility bugs.
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.
It does not, though it's probably a good idea to test a newer version of python too.