Show More
@@ -0,0 +1,7 b'' | |||||
|
1 | from IPython.utils.syspathcontext import appended_to_syspath | |||
|
2 | import pytest | |||
|
3 | ||||
|
4 | ||||
|
5 | def test_append_deprecated(): | |||
|
6 | with pytest.warns(DeprecationWarning): | |||
|
7 | appended_to_syspath(".") |
@@ -15,12 +15,21 b' Authors:' | |||||
15 | #----------------------------------------------------------------------------- |
|
15 | #----------------------------------------------------------------------------- | |
16 |
|
16 | |||
17 | import sys |
|
17 | import sys | |
|
18 | import warnings | |||
18 |
|
19 | |||
19 |
|
20 | |||
20 | class appended_to_syspath(object): |
|
21 | class appended_to_syspath(object): | |
21 | """A context for appending a directory to sys.path for a second.""" |
|
22 | """ | |
|
23 | Deprecated since IPython 8.1, no replacements. | |||
|
24 | ||||
|
25 | A context for appending a directory to sys.path for a second.""" | |||
22 |
|
26 | |||
23 | def __init__(self, dir): |
|
27 | def __init__(self, dir): | |
|
28 | warnings.warn( | |||
|
29 | "`appended_to_syspath` is deprecated since IPython 8.1, and has no replacements", | |||
|
30 | DeprecationWarning, | |||
|
31 | stacklevel=2, | |||
|
32 | ) | |||
24 | self.dir = dir |
|
33 | self.dir = dir | |
25 |
|
34 | |||
26 | def __enter__(self): |
|
35 | def __enter__(self): |
@@ -14,7 +14,10 b' It is a bit ridiculous that we need these.' | |||||
14 |
|
14 | |||
15 | from warnings import warn |
|
15 | from warnings import warn | |
16 |
|
16 | |||
17 | warn("The `IPython.utils.version` module has been deprecated since IPython 8.0.") |
|
17 | warn( | |
|
18 | "The `IPython.utils.version` module has been deprecated since IPython 8.0.", | |||
|
19 | DeprecationWarning, | |||
|
20 | ) | |||
18 |
|
21 | |||
19 |
|
22 | |||
20 | def check_version(v, check): |
|
23 | def check_version(v, check): |
General Comments 0
You need to be logged in to leave comments.
Login now