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

Suggestion for a new test system for Brython #2372

Open
denis-migdal opened this issue Feb 18, 2024 · 0 comments
Open

Suggestion for a new test system for Brython #2372

denis-migdal opened this issue Feb 18, 2024 · 0 comments

Comments

@denis-migdal
Copy link
Contributor

denis-migdal commented Feb 18, 2024

Hi,

I was wondering if it could be interesting to have a command-line test system for Brython (that could be integrated into the github CI/CD) working as follow :

  • a Python script reading a python file.
  • add a settrace() at the start, printing the value of local and global variables at the end of each executed lines (e.g. print(name, type(locals.name), locals.name)).
  • execute it in a new Python process.
  • transform it into JS and execute it in a new Deno process.
  • compare the output of both version.

This could enable to easily check Brython implementation against CPython on existing Python scripts.

This could be useful for unit tests :

  • reading the files of a directory, and splitting files by e.g. "# TEST: name", to then execute it with the test system.
  • run several existing python scripts (e.g. like TypeScript is doing, running the new Typescript version against the TOP100 TS projects).

This system won't be able to test DOM features, as Python doesn't have any.
But we could think of a way to integrate such tests. e.g. instead of executing in a new Python process, transforming it into JS with an old version of Brython, and compare both output.

This could also help people to check their part of their code before upgrading their Brython version.

What do you think ?

EDIT: maybe could also have a REPL version (?)

Cordially,

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

No branches or pull requests

1 participant