Show More
@@ -55,6 +55,6 jobs: | |||
|
55 | 55 | env: |
|
56 | 56 | COLUMNS: 120 |
|
57 | 57 | run: | |
|
58 |
pytest --color=yes -ra |
|
|
58 | pytest --color=yes -raXxs --cov --cov-report=xml | |
|
59 | 59 | - name: Upload coverage to Codecov |
|
60 | 60 | uses: codecov/codecov-action@v2 |
@@ -161,13 +161,6 def no_op(*a, **kw): | |||
|
161 | 161 | class SpaceInInput(Exception): pass |
|
162 | 162 | |
|
163 | 163 | |
|
164 | def get_default_colors(): | |
|
165 | "DEPRECATED" | |
|
166 | warn('get_default_color is deprecated since IPython 5.0, and returns `Neutral` on all platforms.', | |
|
167 | DeprecationWarning, stacklevel=2) | |
|
168 | return 'Neutral' | |
|
169 | ||
|
170 | ||
|
171 | 164 | class SeparateUnicode(Unicode): |
|
172 | 165 | r"""A Unicode subclass to validate separate_in, separate_out, etc. |
|
173 | 166 | |
@@ -440,29 +433,6 class InteractiveShell(SingletonConfigurable): | |||
|
440 | 433 | will be displayed as regular output instead.""" |
|
441 | 434 | ).tag(config=True) |
|
442 | 435 | |
|
443 | # deprecated prompt traits: | |
|
444 | ||
|
445 | prompt_in1 = Unicode('In [\\#]: ', | |
|
446 | help="Deprecated since IPython 4.0 and ignored since 5.0, set TerminalInteractiveShell.prompts object directly." | |
|
447 | ).tag(config=True) | |
|
448 | prompt_in2 = Unicode(' .\\D.: ', | |
|
449 | help="Deprecated since IPython 4.0 and ignored since 5.0, set TerminalInteractiveShell.prompts object directly." | |
|
450 | ).tag(config=True) | |
|
451 | prompt_out = Unicode('Out[\\#]: ', | |
|
452 | help="Deprecated since IPython 4.0 and ignored since 5.0, set TerminalInteractiveShell.prompts object directly." | |
|
453 | ).tag(config=True) | |
|
454 | prompts_pad_left = Bool(True, | |
|
455 | help="Deprecated since IPython 4.0 and ignored since 5.0, set TerminalInteractiveShell.prompts object directly." | |
|
456 | ).tag(config=True) | |
|
457 | ||
|
458 | @observe('prompt_in1', 'prompt_in2', 'prompt_out', 'prompt_pad_left') | |
|
459 | def _prompt_trait_changed(self, change): | |
|
460 | name = change['name'] | |
|
461 | warn("InteractiveShell.{name} is deprecated since IPython 4.0" | |
|
462 | " and ignored since 5.0, set TerminalInteractiveShell.prompts" | |
|
463 | " object directly.".format(name=name)) | |
|
464 | ||
|
465 | # protect against weird cases where self.config may not exist: | |
|
466 | 436 | |
|
467 | 437 | show_rewritten_input = Bool(True, |
|
468 | 438 | help="Show rewritten input, e.g. for autocall." |
@@ -2038,19 +2008,6 class InteractiveShell(SingletonConfigurable): | |||
|
2038 | 2008 | the %paste magic.""" |
|
2039 | 2009 | self.showsyntaxerror() |
|
2040 | 2010 | |
|
2041 | #------------------------------------------------------------------------- | |
|
2042 | # Things related to readline | |
|
2043 | #------------------------------------------------------------------------- | |
|
2044 | ||
|
2045 | def init_readline(self): | |
|
2046 | """DEPRECATED | |
|
2047 | ||
|
2048 | Moved to terminal subclass, here only to simplify the init logic.""" | |
|
2049 | # Set a number of methods that depend on readline to be no-op | |
|
2050 | warnings.warn('`init_readline` is no-op since IPython 5.0 and is Deprecated', | |
|
2051 | DeprecationWarning, stacklevel=2) | |
|
2052 | self.set_custom_completer = no_op | |
|
2053 | ||
|
2054 | 2011 | @skip_doctest |
|
2055 | 2012 | def set_next_input(self, s, replace=False): |
|
2056 | 2013 | """ Sets the 'default' input string for the next command line. |
@@ -3513,20 +3470,6 class InteractiveShell(SingletonConfigurable): | |||
|
3513 | 3470 | file_path.write_text(data) |
|
3514 | 3471 | return filename |
|
3515 | 3472 | |
|
3516 | @undoc | |
|
3517 | def write(self,data): | |
|
3518 | """DEPRECATED: Write a string to the default output""" | |
|
3519 | warn('InteractiveShell.write() is deprecated, use sys.stdout instead', | |
|
3520 | DeprecationWarning, stacklevel=2) | |
|
3521 | sys.stdout.write(data) | |
|
3522 | ||
|
3523 | @undoc | |
|
3524 | def write_err(self,data): | |
|
3525 | """DEPRECATED: Write a string to the default error output""" | |
|
3526 | warn('InteractiveShell.write_err() is deprecated, use sys.stderr instead', | |
|
3527 | DeprecationWarning, stacklevel=2) | |
|
3528 | sys.stderr.write(data) | |
|
3529 | ||
|
3530 | 3473 | def ask_yes_no(self, prompt, default=None, interrupt=None): |
|
3531 | 3474 | if self.quiet: |
|
3532 | 3475 | return True |
@@ -149,8 +149,8 class PasteTestCase(TestCase): | |||
|
149 | 149 | def test_paste_echo(self): |
|
150 | 150 | "Also test self.paste echoing, by temporarily faking the writer" |
|
151 | 151 | w = StringIO() |
|
152 |
write |
|
|
153 |
|
|
|
152 | old_write = sys.stdout.write | |
|
153 | sys.stdout.write = w.write | |
|
154 | 154 | code = """ |
|
155 | 155 | a = 100 |
|
156 | 156 | b = 200""" |
@@ -158,7 +158,7 class PasteTestCase(TestCase): | |||
|
158 | 158 | self.paste(code,'') |
|
159 | 159 | out = w.getvalue() |
|
160 | 160 | finally: |
|
161 |
|
|
|
161 | sys.stdout.write = old_write | |
|
162 | 162 | self.assertEqual(ip.user_ns["a"], 100) |
|
163 | 163 | self.assertEqual(ip.user_ns["b"], 200) |
|
164 | 164 | assert out == code + "\n## -- End pasted text --\n" |
@@ -198,11 +198,10 class TerminalMagics(Magics): | |||
|
198 | 198 | |
|
199 | 199 | # By default, echo back to terminal unless quiet mode is requested |
|
200 | 200 | if 'q' not in opts: |
|
201 |
write |
|
|
202 | write(self.shell.pycolorize(block)) | |
|
203 | if not block.endswith('\n'): | |
|
204 | write('\n') | |
|
205 | write("## -- End pasted text --\n") | |
|
201 | sys.stdout.write(self.shell.pycolorize(block)) | |
|
202 | if not block.endswith("\n"): | |
|
203 | sys.stdout.write("\n") | |
|
204 | sys.stdout.write("## -- End pasted text --\n") | |
|
206 | 205 | |
|
207 | 206 | self.store_or_execute(block, name) |
|
208 | 207 |
@@ -233,11 +233,6 def raw_print_err(*args, **kw): | |||
|
233 | 233 | file=sys.__stderr__) |
|
234 | 234 | sys.__stderr__.flush() |
|
235 | 235 | |
|
236 | # used by IPykernel <- 4.9. Removed during IPython 7-dev period and re-added | |
|
237 | # Keep for a version or two then should remove | |
|
238 | rprint = raw_print | |
|
239 | rprinte = raw_print_err | |
|
240 | ||
|
241 | 236 | @undoc |
|
242 | 237 | def unicode_std_stream(stream='stdout'): |
|
243 | 238 | """DEPRECATED, moved to nbconvert.utils.io""" |
General Comments 0
You need to be logged in to leave comments.
Login now