Skip to content

Add test cases for AST serialization#3276

Merged
JukkaL merged 5 commits intomasterfrom
test-serialize
May 5, 2017
Merged

Add test cases for AST serialization#3276
JukkaL merged 5 commits intomasterfrom
test-serialize

Conversation

@JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Apr 28, 2017

The test cases use a serialized module in incremental mode
in various ways to make sure that all important information
in the AST nodes is preserved during serialization and
deserialization.

These are all very straightforward. The idea is to help catch
regressions early and to make it easier to refactor or optimize
serialization code. Working on these helped find 2 issues -- I
separated the first to PR #3275. The second issue (#3274) is
still unfixed and there is a skipped test case for it.

More complex cases such as import cycles will still go to
check-incremental.test.

JukkaL added 2 commits April 28, 2017 15:22
The test cases use a serialized module in incremental mode
in various ways to make sure that all important information
in the AST nodes is preserved during serialization and
deserialization.

These are all very straightforward. The idea is to help catch
regressions early and to make it easier to refactor or optimize
serialization code. These found 2 issues -- separated the first
to PR #3275. The second issue (#3274) is still unfixed and there
is a skipped test case for it.

More complex cases such as import cycles will still go to
check-incremental.test.
try:
self.run_case_once(testcase, 1)
self.run_case_once(testcase, 2)
finally:
Copy link
Member

Choose a reason for hiding this comment

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

There are now three try/finally blocks in this function that resture experiments.STRICT_OPTIONAL. Let's have a single one that does this, wrapping all different cases.

@@ -0,0 +1,1202 @@
-- Serialization test cases (incremental type checking)
Copy link
Member

Choose a reason for hiding this comment

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

Where did you get all these tests? I hope you don't mind I'm not going to review all of them carefully, I trust you.

@JukkaL
Copy link
Collaborator Author

JukkaL commented Apr 29, 2017

Where did you get all these tests? I hope you don't mind I'm not going to review all of them carefully, I trust you.

I wrote down a list of interesting mypy features and manually created tests for those that seemed relevant. Yeah, it's okay not to review them carefully.

@gvanrossum
Copy link
Member

Is this still blocked on quick mode crashes?

@JukkaL
Copy link
Collaborator Author

JukkaL commented May 5, 2017

I've left out all test cases that cause quick mode crashes, so this can be merged. I'll merge this now since this only touches test cases.

@JukkaL JukkaL merged commit 5788635 into master May 5, 2017
@gvanrossum gvanrossum deleted the test-serialize branch May 9, 2017 18:42
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.

2 participants