we-like-parsers / pegen

PEG parser generator for Python
https://we-like-parsers.github.io/pegen/
MIT License
150 stars 32 forks source link

Add ability to run each test separately, thus easier debugging #73

Closed 0dminnimda closed 2 years ago

0dminnimda commented 2 years ago

Coincidently format imports

MatthieuDartiailh commented 2 years ago

This can already be achieved by specifying which file to run when invoking pytest so I do not see the value honestly. The formatting however is always nice (in a different PR) but we should also figure out how to have the CIs ensure it. I believe it required to touch too much the tox config last time I checked but I am not a tox expert by any means.

Feel free to re-open if I missed something.

0dminnimda commented 2 years ago

This can already be achieved by specifying which file to run when invoking pytest

So, if I'm corrct, you propose to use the same code (in the other file I guess) but just specify the file to debug. Well, it'll work but it's not really convinient, opposed to just running the file in the debug mode and not worrying about paths and stuff ¯\_(ツ)_/¯.

At least I can say that I find myself editing tests that don't have those lines and it's not convinient to add them in each branch

Of coure if you think it don't fit the repo, you can left this closed, but it defenetly impoves the debug process and is a more friendly way. Aaand I don't see how it could hurt ;P

MatthieuDartiailh commented 2 years ago

I guess the main issue is that I do not understand your workflow. Since the testsuite uses pytest I run it using pytest tests . If I want to run a single file I just specify it and to drop to pdb on a failed test I use the --pdb option. As a consequence I do not see the need to add pytest.main to every file (I actually never used it).

0dminnimda commented 2 years ago

Oh, well I use ide for debugging