[GRASS-git] [OSGeo/grass] bd65b0: grass.script: Pass env to debug_level (#5920)
Vaclav Petras
noreply at github.com
Fri Jun 20 16:09:37 PDT 2025
Branch: refs/heads/main
Home: https://github.com/OSGeo/grass
Commit: bd65b0a543ec9ccfbf1ddb91f4e9dc121ccd12de
https://github.com/OSGeo/grass/commit/bd65b0a543ec9ccfbf1ddb91f4e9dc121ccd12de
Author: Vaclav Petras <wenzeslaus at gmail.com>
Date: 2025-06-20 (Fri, 20 Jun 2025)
Changed paths:
M general/g.list/tests/conftest.py
M python/grass/script/core.py
Log Message:
-----------
grass.script: Pass env to debug_level (#5920)
To get a debug level Python code calls debug_level function which in turn needs to call g.gisenv because the debug level is stored in GRASS gisenv variable (and not as a system environment variable). For call to g.gisenv, one needs to have a session (GISRC) set up, so env is needed when it is only a local one (and not os.environ).
This also removes the monkeypatch fixture from the recently added test for g.list which, without the monkeypatch, failed on Windows with GISRC missing from g.gisenv indicating that os.environ was set up with the runtime (PATH etc.), but didn't have an active session (GISRC etc.). This passes the correct local environment through env all the way to g.gisenv. (Additionally, the fixture scope is changed to module, so that it is created only once.)
To unsubscribe from these emails, change your notification settings at https://github.com/OSGeo/grass/settings/notifications
More information about the grass-commit
mailing list