Skip to content

Commit

Permalink
test(test_map.py): copy fixtures to avoid any effects from modificati…
Browse files Browse the repository at this point in the history
…on over successive tests
  • Loading branch information
aleaf committed Oct 18, 2024
1 parent 59220ab commit f855e86
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions sfrmaker/test/test_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def name_path():


@pytest.fixture(scope="module")
def lines(test_data_path, name_path):
def get_lines(test_data_path, name_path):
name, path = name_path
lns = sfrmaker.Lines.from_shapefile(
test_data_path / f'{path}/flowlines.shp'.format(test_data_path, path),
Expand All @@ -31,12 +31,19 @@ def lines(test_data_path, name_path):
return lns


@pytest.fixture(scope='function')
def lines(get_lines):
return copy.deepcopy(get_lines)

@pytest.fixture(scope="module")
def grid(test_data_path, name_path):
def get_grid(test_data_path, name_path):
name, path = name_path
grd = sfrmaker.StructuredGrid.from_json('{0}/{1}/{1}/{1}_grid.json'.format(test_data_path, path))
return grd

@pytest.fixture(scope='function')
def grid(get_grid):
return copy.deepcopy(get_grid)

@pytest.fixture(scope="module")
def sfr(lines, grid):
Expand Down

0 comments on commit f855e86

Please sign in to comment.