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

Improve testing of hy2py #1547

Merged
merged 1 commit into from
Apr 9, 2018
Merged

Conversation

Kodiologist
Copy link
Member

No description provided.

@Kodiologist Kodiologist force-pushed the hy2py-testing branch 5 times, most recently from 30903a5 to 432e81f Compare March 26, 2018 15:43
import importlib.util
spec = importlib.util.spec_from_file_location(name, path)
m = importlib.util.module_from_spec(spec)
spec.loader.exec_module(m)
Copy link
Contributor

Choose a reason for hiding this comment

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

This works on PY35 as well, for what its worth. spec_from_file_location came with 3.4 and module_from_spec with 3.5

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried enabling this for Python 3.5 and I got a weird crash inside pytest, so I've changed it back.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, probably won't work until #1518 is in. I tested it there. We don't implement the importlib APIs correctly.

@Kodiologist Kodiologist force-pushed the hy2py-testing branch 3 times, most recently from 83f34b2 to 7f4ce6c Compare March 28, 2018 15:30
Instead of just checking that hy2py outputs a nonempty string and doesn't crash, we check that a hy2py-generated Python program works the same as the original Hy program.

This test suggests my plan to make hy2py output real Python has succeeded, so I updated NEWS accordingly.
@Kodiologist Kodiologist merged commit 736426f into hylang:master Apr 9, 2018
@Kodiologist Kodiologist deleted the hy2py-testing branch January 20, 2019 14:38
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