Skip to content

Commit 7e6065a

Browse files
Fix tests
1 parent dbaeb3f commit 7e6065a

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

tests/borefield_test.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,30 @@ def test_borefield_init(field, request):
3434

3535

3636
# Test Borefield.__add__ and Borefield.__radd__
37-
@pytest.mark.parametrize("field, other_field, field_list, other_field_list", [
38-
# Using Borefield and Borehole objects
39-
('single_borehole', 'two_boreholes_inclined', False, False),
40-
('ten_boreholes_rectangular', 'single_borehole_short', False, False),
41-
('ten_boreholes_rectangular', 'two_boreholes_inclined', False, False),
37+
@pytest.mark.parametrize("field, other_field, field_list, other_field_list, field_borehole, other_field_borehole", [
38+
# Using Borefield objects
39+
('ten_boreholes_rectangular', 'two_boreholes_inclined', False, False, False, False),
40+
# Using Borefield objects
41+
('single_borehole', 'two_boreholes_inclined', False, False, True, False),
42+
('ten_boreholes_rectangular', 'single_borehole_short', False, False, False, True),
4243
# Using Borefield as lists
43-
('ten_boreholes_rectangular', 'two_boreholes_inclined', False, True),
44-
('ten_boreholes_rectangular', 'two_boreholes_inclined', True, False),
44+
('ten_boreholes_rectangular', 'two_boreholes_inclined', False, True, False, False),
45+
('ten_boreholes_rectangular', 'two_boreholes_inclined', True, False, False, False),
4546
])
46-
def test_borefield_add(field, other_field, field_list, other_field_list, request):
47-
field = request.field
48-
other_field = request.other_field
47+
def test_borefield_add(field, other_field, field_list, other_field_list, field_borehole, other_field_borehole, request):
48+
field = request.getfixturevalue(field)
49+
other_field = request.getfixturevalue(other_field)
4950
reference_field = gt.borefield.Borefield.from_boreholes(
5051
field.to_boreholes() + other_field.to_boreholes()
5152
)
5253
if field_list:
5354
field = field.to_boreholes()
5455
if other_field_list:
5556
other_field = other_field.to_boreholes()
57+
if field_borehole:
58+
field = field[0]
59+
if other_field_borehole:
60+
other_field = other_field[0]
5661
assert field + other_field_list == reference_field
5762

5863

tests/boreholes_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ def test_borehole_init():
4040
('single_borehole', 'single_borehole_short', False, True),
4141
])
4242
def test_borehole_add(borehole, other_borehole, borehole_list, other_borehole_list, request):
43-
borehole = request.borehole
44-
other_borehole = request.other_borehole
43+
borehole = request.getfixturevalue(borehole)[0]
44+
other_borehole = request.getfixturevalue(other_borehole)[0]
4545
field = gt.borefield.Borefield.from_boreholes(
4646
[borehole, other_borehole])
4747
if borehole_list:

0 commit comments

Comments
 (0)