-
Notifications
You must be signed in to change notification settings - Fork 260
Implement Async Function Support #387
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,8 +49,7 @@ | |
| # Tests as closely as possible to make keeping them in sync easier. | ||
|
|
||
| # These map distinct reasons for failures, so we an easily find them. | ||
| xfail_async = pytest.mark.xfail(reason="Implement async methods", strict=True) | ||
| xfail_callbacks = pytest.mark.xfail(reason="Implement callback support", strict=True) | ||
| xfail_callbacks = pytest.mark.skip(reason="Implement callback support") | ||
|
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. I had to switch this to a skip, because running these tests and failing on them left the process in a bad state. |
||
|
|
||
|
|
||
| class DerivedFromAllTypes(AllTypes): | ||
|
|
@@ -464,39 +463,33 @@ def test_creationOfNativeObjectsFromJavaScriptObjects(): | |
| assert unmarshalled_native_obj.__class__ == MulTen | ||
|
|
||
|
|
||
| @xfail_async | ||
| def test_asyncOverrides_callAsyncMethod(): | ||
| obj = AsyncVirtualMethods() | ||
| assert obj.call_me() == 128 | ||
| assert obj.override_me(44) == 528 | ||
|
|
||
|
|
||
| @xfail_async | ||
| def test_asyncOverrides_overrideAsyncMethod(): | ||
| obj = OverrideAsyncMethods() | ||
| obj.call_me() == 4452 | ||
|
|
||
|
|
||
| @xfail_async | ||
| def test_asyncOverrides_overrideAsyncMethodByParentClass(): | ||
| obj = OverrideAsyncMethodsByBaseClass() | ||
| obj.call_me() == 4452 | ||
|
|
||
|
|
||
| @xfail_async | ||
| def test_asyncOverrides_overrideCallsSuper(): | ||
| obj = OverrideCallsSuper() | ||
| assert obj.override_me(12) == 1441 | ||
| assert obj.call_me() == 1209 | ||
|
|
||
|
|
||
| @xfail_async | ||
| def test_asyncOverrides_twoOverrides(): | ||
| obj = TwoOverrides() | ||
| assert obj.call_me() == 684 | ||
|
|
||
|
|
||
| @xfail_async | ||
| def test_asyncOverrides_overrideThrows(): | ||
| class ThrowingAsyncVirtualMethods(AsyncVirtualMethods): | ||
| def override_me(self, mult): | ||
|
|
@@ -783,15 +776,14 @@ def test_reservedKeywordsAreSlugifiedInMethodNames(): | |
| obj.return_() | ||
|
|
||
|
|
||
| @xfail_async | ||
| def test_nodeStandardLibrary(): | ||
| obj = NodeStandardLibrary() | ||
|
|
||
| assert obj.fs_read_file() == "Hello, resource!" | ||
| assert obj.fs_read_file_sync() == "Hello, resource! SYNC!" | ||
| assert len(obj.get_os_platform()) > 0 | ||
| assert len(obj.os_platform) > 0 | ||
| assert ( | ||
| obj.crypto_sha_256() | ||
| obj.crypto_sha256() | ||
| == "6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50" | ||
| ) | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Note, this doesn't actually handle everything, this is one of the things that we need to coordinate with the sync callbacks with over who wants to "own" doing the complete implementation of this.
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.
Do you just want to merge this version and then I can do a PR with the updated version?
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.
That works for me.