-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Remove unused rust impl for formatting dis output #7660
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
Changes from all commits
2cbbaf1
774bdcd
ad9feb0
256252c
7e8938d
693ab8c
ce8b0c8
d9751c9
b0ec4a0
dc4c857
bae530c
7a77e65
58c8d53
a3f690e
182b4f5
c235e6c
42353fa
2450d69
b5326b3
e4f7ea0
89a4da6
8f3d793
1cc518f
ad2b24f
fd5d487
5c3aa0d
15d212f
5806655
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12275,26 +12275,6 @@ def f(sys, os, file): | |
| }) | ||
| } | ||
|
|
||
| macro_rules! assert_dis_snapshot { | ||
| ($value:expr) => { | ||
| insta::assert_snapshot!( | ||
| insta::internals::AutoName, | ||
| $value.display_expand_code_objects().to_string(), | ||
| stringify!($value) | ||
| ) | ||
| }; | ||
| } | ||
|
|
||
| #[test] | ||
| fn test_if_ors() { | ||
| assert_dis_snapshot!(compile_exec( | ||
| "\ | ||
| if True or False or False: | ||
| pass | ||
|
Comment on lines
-12289
to
-12293
Member
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. oh.. are these test going to be entirely deleted? This is not desired. Can we replace the snapshot test to other way not depending on internal dis?
Contributor
Author
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. The only way I can think of is to move them under let module = vm.import("dis", 0)?;
let dis = module.get_attr("dis", vm)?;
let res = dis.call(my_pycode, vm)?;
// <convert res to String and pass to Insta>
Contributor
Author
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. @youknowone lmk what you think |
||
| " | ||
| )); | ||
| } | ||
|
|
||
| #[test] | ||
| fn test_trace_assert_true_try_pair() { | ||
| let trace = compile_exec_late_cfg_trace( | ||
|
|
@@ -12529,44 +12509,6 @@ def f(self): | |
| ); | ||
| } | ||
|
|
||
| #[test] | ||
| fn test_if_ands() { | ||
| assert_dis_snapshot!(compile_exec( | ||
| "\ | ||
| if True and False and False: | ||
| pass | ||
| " | ||
| )); | ||
| } | ||
|
|
||
| #[test] | ||
| fn test_if_mixed() { | ||
| assert_dis_snapshot!(compile_exec( | ||
| "\ | ||
| if (True and False) or (False and True): | ||
| pass | ||
| " | ||
| )); | ||
| } | ||
|
|
||
| #[test] | ||
| fn test_nested_bool_op() { | ||
| assert_dis_snapshot!(compile_exec( | ||
| "\ | ||
| x = Test() and False or False | ||
| " | ||
| )); | ||
| } | ||
|
|
||
| #[test] | ||
| fn test_const_bool_not_op() { | ||
| assert_dis_snapshot!(compile_exec_optimized( | ||
| "\ | ||
| x = not True | ||
| " | ||
| )); | ||
| } | ||
|
|
||
| #[test] | ||
| fn test_plain_constant_bool_op_folds_to_selected_operand() { | ||
| let code = compile_exec( | ||
|
|
@@ -12840,24 +12782,6 @@ def f(self, mod): | |
| ); | ||
| } | ||
|
|
||
| #[test] | ||
| fn test_nested_double_async_with() { | ||
| assert_dis_snapshot!(compile_exec( | ||
| "\ | ||
| async def test(): | ||
| for stop_exc in (StopIteration('spam'), StopAsyncIteration('ham')): | ||
| with self.subTest(type=type(stop_exc)): | ||
| try: | ||
| async with egg(): | ||
| raise stop_exc | ||
| except Exception as ex: | ||
| self.assertIs(ex, stop_exc) | ||
| else: | ||
| self.fail(f'{stop_exc} was suppressed') | ||
| " | ||
| )); | ||
| } | ||
|
|
||
| #[test] | ||
| fn test_scope_exit_instructions_keep_line_numbers() { | ||
| let code = compile_exec( | ||
|
|
@@ -14006,20 +13930,6 @@ def f(expected_ns, namespace): | |
| } | ||
| } | ||
|
|
||
| #[test] | ||
| fn test_bare_function_annotations_check_attribute_and_subscript_expressions() { | ||
| assert_dis_snapshot!(compile_exec( | ||
| "\ | ||
| def f(one: int): | ||
| int.new_attr: int | ||
| [list][0].new_attr: [int, str] | ||
| my_lst = [1] | ||
| my_lst[one]: int | ||
| return my_lst | ||
| " | ||
| )); | ||
| } | ||
|
|
||
| #[test] | ||
| fn test_non_simple_bare_name_annotation_does_not_create_local_binding() { | ||
| let code = compile_exec( | ||
|
|
@@ -14052,16 +13962,6 @@ def f2bad(): | |
| ); | ||
| } | ||
|
|
||
| #[test] | ||
| fn test_constant_true_if_pass_keeps_line_anchor_nop() { | ||
| assert_dis_snapshot!(compile_exec( | ||
| "\ | ||
| if 1: | ||
| pass | ||
| " | ||
| )); | ||
| } | ||
|
|
||
| #[test] | ||
| fn test_negative_constant_binop_folds_after_unary_folding() { | ||
| let code = compile_exec( | ||
|
|
||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
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 about 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.
I still think there's a value to putting it at the top. other tools in the future (or even exiting ones) might look at this value, it because a standard from what I can tell. but it's not a hill I'm willing to die on