Skip to content

Commit

Permalink
grass.script: Remove copy-pasted code from tests (#3674)
Browse files Browse the repository at this point in the history
While not harmful for what is tested, the code was copy-pasted from an unrelated test and is not needed in the given tests because init takes care of initialization in the desired location.
  • Loading branch information
wenzeslaus committed Apr 27, 2024
1 parent a02702a commit 8a05d9f
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions python/grass/script/tests/grass_script_core_location_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ def test_without_session(tmp_path):
wkt_file = tmp_path / name / "PERMANENT" / "PROJ_WKT"
assert wkt_file.exists()
with gs.setup.init(tmp_path / name):
gs.run_command("g.gisenv", set=f"GISDBASE={tmp_path}")
gs.run_command("g.gisenv", set=f"LOCATION_NAME={name}")
gs.run_command("g.gisenv", set="MAPSET=PERMANENT")
epsg = gs.parse_command("g.proj", flags="g")["srid"]
assert epsg == "EPSG:3358"

Expand Down Expand Up @@ -109,9 +106,6 @@ def test_path_only(tmp_path):
assert mapset_path.exists()
assert wkt_file.exists()
with gs.setup.init(full_path):
gs.run_command("g.gisenv", set=f"GISDBASE={tmp_path}")
gs.run_command("g.gisenv", set=f"LOCATION_NAME={desired_location}")
gs.run_command("g.gisenv", set="MAPSET=PERMANENT")
epsg = gs.parse_command("g.proj", flags="g")["srid"]
assert epsg == "EPSG:3358"

Expand All @@ -123,9 +117,6 @@ def test_create_project(tmp_path):
wkt_file = tmp_path / name / "PERMANENT" / "PROJ_WKT"
assert wkt_file.exists()
with gs.setup.init(tmp_path / name):
gs.run_command("g.gisenv", set=f"GISDBASE={tmp_path}")
gs.run_command("g.gisenv", set=f"LOCATION_NAME={name}")
gs.run_command("g.gisenv", set="MAPSET=PERMANENT")
epsg = gs.parse_command("g.proj", flags="g")["srid"]
assert epsg == "EPSG:3358"

Expand Down

0 comments on commit 8a05d9f

Please sign in to comment.