-
-
Notifications
You must be signed in to change notification settings - Fork 331
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
tests: replaced module imports to the top #4656
Conversation
I'm not convinced (yet) that this is a better pattern. We don't see that often, and the real problem is the fact that plying around with the paths was used there, as our Python ctypes binding dont seem available when running plain pytest, instead of the heavy workarounds used when loading grass and executing scripts inside that shell, like our gunittest does. In my opinion, running Python scripts like with pytest, the expected behaviour should be to just work when grass is installed. But all that is a larger infrastructure-wide issue, that @wenzeslaus has been slowly working on, and is also my common thread across all my efforts in the last year and a half. So to recap, I think that the problem in the file is the use of the two lines that play with the path (it's really not a good practice, I saw it more in Python 2 code when users didn't understand why a script didn't work and stopped when adding enough so it works on their machine). If it was really a test file, it could be run with the current workaround for some gunittest-tests to run through pytest: launch a grass shell, (the paths are set up), and inside call Python, pytest, or the script wanted. |
I suppose this benchmark was useful when developing pygrass, less so now. |
# Configuration file for Sphinx: | ||
# Ignoring import/code mix and line length. | ||
# Files not managed by Black | ||
python/grass/imaging/images2gif.py: E226 |
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.
At the next PR, I think you could have a clean up of the comments of sections that are now empty.
Fixes
E402