Skip to content
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

test ipython support #69

Merged
merged 2 commits into from
Sep 30, 2023
Merged

test ipython support #69

merged 2 commits into from
Sep 30, 2023

Conversation

15r10nk
Copy link
Collaborator

@15r10nk 15r10nk commented Mar 29, 2023

resolve #59
resolve #68

@15r10nk 15r10nk self-assigned this Mar 30, 2023
@15r10nk 15r10nk force-pushed the test_ipython branch 5 times, most recently from 8c2fdec to e31a732 Compare March 31, 2023 09:41
@15r10nk 15r10nk marked this pull request as ready for review March 31, 2023 10:25
@15r10nk
Copy link
Collaborator Author

15r10nk commented Mar 31, 2023

hi @alexmojaki, I integrated the ipython tests. Maybe you can review it if you have time.

@15r10nk 15r10nk requested a review from alexmojaki April 4, 2023 19:27
.github/workflows/test.yml Show resolved Hide resolved
Comment on lines 284 to 322
and not isinstance(node,ast.Call)
and any(isinstance(p, ast.Assert) for p in parents(node))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
and not isinstance(node,ast.Call)
and any(isinstance(p, ast.Assert) for p in parents(node))
and isinstance(node,ast.Assert)

just confirming that this doesn't work?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it does not work. The CALL of the generated assertion has the source range of the comparison.

  1 assert self is None or frame, ()                                                                                                                                                                               
all bytecodes in this range:

<module>:                                                                                                                     
 offset  start  end   instruction                   ast-node                                                                  
      0  0:0    1:0   RESUME(0)                     NoneType                                                                  
      2  1:7    1:11  LOAD_NAME(self)               Name(self)                                                                
      4  1:7    1:19  POP_JUMP_FORWARD_IF_NONE(30)  VerifierFailure: ast.Compare is not created from POP_JUMP_FORWARD_IF_NONE 
      6  1:23   1:28  LOAD_NAME(frame)              Name(frame)                                                               
      8  1:7    1:19  POP_JUMP_FORWARD_IF_TRUE(34)  VerifierFailure: ast.Compare is not created from POP_JUMP_FORWARD_IF_TRUE 
     10  1:7    1:19  LOAD_ASSERTION_ERROR(None)    VerifierFailure: ast.Compare is not created from LOAD_ASSERTION_ERROR     
     12  1:30   1:32  LOAD_CONST(())                VerifierFailure: ast.Tuple is not created from LOAD_CONST                 
     14  1:7    1:19  PRECALL(0)                    VerifierFailure: ast.Compare is not created from PRECALL                  
     16  1:7    1:19  CACHE(None)                   VerifierFailure: ast.Compare is not created from PRECALL                  
     18  1:7    1:19  CALL(0)                       VerifierFailure: ast.Compare is not created from CALL                     
     20  1:7    1:19  CACHE(None)                   VerifierFailure: ast.Compare is not created from CALL                     
     22  1:7    1:19  CACHE(None)                   VerifierFailure: ast.Compare is not created from CALL                     
     24  1:7    1:19  CACHE(None)                   VerifierFailure: ast.Compare is not created from CALL                     
     26  1:7    1:19  CACHE(None)                   VerifierFailure: ast.Compare is not created from CALL                     
     28  1:7    1:19  RAISE_VARARGS(1)              VerifierFailure: ast.Compare is not created from RAISE_VARARGS            
     30  1:7    1:19  LOAD_CONST(None)              VerifierFailure: ast.Compare is not created from LOAD_CONST               
     32  1:7    1:19  RETURN_VALUE(None)            VerifierFailure: ast.Compare is not created from RETURN_VALUE             
     34  1:7    1:19  LOAD_CONST(None)              VerifierFailure: ast.Compare is not created from LOAD_CONST               
     36  1:7    1:19  RETURN_VALUE(None)            VerifierFailure: ast.Compare is not created from RETURN_VALUE             

@@ -729,6 +729,10 @@ def test_sample_files(self, full_filename, result_filename):
assert result == json.load(infile)


@pytest.mark.skipif(
NodeFinder.__name__ == "SentinelNodeFinder",
reason="The SentinelNodeFinder has problems in some situations (see skip_sentinel)",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a huge amount of testing to skip for everything <3.11

Copy link
Collaborator Author

@15r10nk 15r10nk May 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the problem appeared when I added the ipython and coverage dependencies.
Some files trigger the same issues which gets triggered by test_small_samples.
This small_samples are already excluded for the SentinelNodeFinder (skip_sentinel array).

I don't know how easy it is to fix this issues in the SentinelNodeFinder.
I don't want to put to much time into this, because I don't have to much and because #64 can maybe replace the SentinelNodeFinder for 3.8, 3.9 and 3.10 soon.

I also created https://github.com/15r10nk/pysource-codegen with the coal to use it to test executing. I'm pretty sure that I will find more issues in all of the 3 node finders. The question here is if it is possible to solve them all.

It will be some work, but based on my experience with Index/PositionNodefinder, I'm pretty sure they are solvable.
However I have no experience with the SentinelNodeFinder. What do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm currently working on the SentinelNodeFinder and try to fix some Issues to get a better understanding

@alexmojaki
Copy link
Owner

Sorry for the silence, life has been overwhelming. Thanks for working on this.

@15r10nk
Copy link
Collaborator Author

15r10nk commented May 15, 2023

Sorry for the silence, life has been overwhelming. Thanks for working on this.

I know the problem when you don't have enough time for everything. Thank you for taking care of it.

tests/test_ipython.py Outdated Show resolved Hide resolved
tests/test_ipython.py Outdated Show resolved Hide resolved
@alexmojaki alexmojaki merged commit 05d6c67 into alexmojaki:master Sep 30, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tests are failing for storing to two attributes with the same name Automated tests for IPython
2 participants