Skip to content

Commit

Permalink
Attempt to isolate side effect
Browse files Browse the repository at this point in the history
  • Loading branch information
jrobinAV committed Feb 15, 2024
1 parent 6ce5b0f commit f4ee858
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions tests/core/data/test_write_multiple_sheet_excel_data_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,11 @@ def test_write_with_header_multiple_sheet_custom_exposed_type_with_sheet_name(tm
assert all(actual == expected for actual, expected in zip(excel_dn_data[sheet_name], sheet_data[sheet_name]))


def test_write_with_header_multiple_sheet_custom_exposed_type_without_sheet_name(tmp_excel_file_2):
def test_write_with_header_multiple_sheet_custom_exposed_type_without_sheet_name(tmp_excel_file):
excel_dn = ExcelDataNode(
"foo",
Scope.SCENARIO,
properties={"path": tmp_excel_file_2, "exposed_type": MyCustomObject})
properties={"path": tmp_excel_file, "exposed_type": MyCustomObject})

row_1 = [MyCustomObject(0, 1, "hi"), MyCustomObject(1, 2, "world"), MyCustomObject(2, 3, "text")]
row_2 = [MyCustomObject(0, 4, "hello"), MyCustomObject(1, 5, "abc"), MyCustomObject(2, 6, ".")]
Expand All @@ -219,11 +219,11 @@ def test_write_with_header_multiple_sheet_custom_exposed_type_without_sheet_name
assert all(actual == expected for actual, expected in zip(excel_dn_data[sheet_name], sheet_data[sheet_name]))


def test_write_without_header_multiple_sheet_pandas_with_sheet_name(tmp_excel_file_2):
def test_write_without_header_multiple_sheet_pandas_with_sheet_name(tmp_excel_file):
excel_dn = ExcelDataNode(
"foo",
Scope.SCENARIO,
properties={"path": tmp_excel_file_2, "sheet_name": sheet_names, "has_header": False}
properties={"path": tmp_excel_file, "sheet_name": sheet_names, "has_header": False}
)

df_1 = pd.DataFrame([*zip([1, 2, 3])])
Expand Down Expand Up @@ -252,8 +252,8 @@ def test_write_without_header_multiple_sheet_pandas_with_sheet_name(tmp_excel_fi
assert np.array_equal(excel_dn_data[sheet_name].to_numpy(), pd.DataFrame(sheet_data[sheet_name]).to_numpy())


def test_write_without_header_multiple_sheet_pandas_without_sheet_name(tmp_excel_file_2):
excel_dn = ExcelDataNode("foo", Scope.SCENARIO, properties={"path": tmp_excel_file_2, "has_header": False})
def test_write_without_header_multiple_sheet_pandas_without_sheet_name(tmp_excel_file):
excel_dn = ExcelDataNode("foo", Scope.SCENARIO, properties={"path": tmp_excel_file, "has_header": False})

df_1 = pd.DataFrame([*zip([1, 2, 3])])
df_2 = pd.DataFrame([*zip([4, 5, 6])])
Expand Down Expand Up @@ -281,11 +281,11 @@ def test_write_without_header_multiple_sheet_pandas_without_sheet_name(tmp_excel
assert np.array_equal(excel_dn_data[sheet_name].to_numpy(), pd.DataFrame(sheet_data[sheet_name]).to_numpy())


def test_write_without_header_multiple_sheet_numpy_with_sheet_name(tmp_excel_file_3):
def test_write_without_header_multiple_sheet_numpy_with_sheet_name(tmp_excel_file):
excel_dn = ExcelDataNode(
"foo",
Scope.SCENARIO,
properties={"path": tmp_excel_file_3, "sheet_name": sheet_names, "exposed_type": "numpy", "has_header": False},
properties={"path": tmp_excel_file, "sheet_name": sheet_names, "exposed_type": "numpy", "has_header": False},
)

arr_1 = np.array([[1], [2], [3]])
Expand All @@ -309,11 +309,11 @@ def test_write_without_header_multiple_sheet_numpy_with_sheet_name(tmp_excel_fil
assert np.array_equal(excel_dn_data[sheet_name], sheet_data[sheet_name])


def test_write_without_header_multiple_sheet_numpy_without_sheet_name(tmp_excel_file_3):
def test_write_without_header_multiple_sheet_numpy_without_sheet_name(tmp_excel_file):
excel_dn = ExcelDataNode(
"foo",
Scope.SCENARIO,
properties={"path": tmp_excel_file_3, "exposed_type": "numpy", "has_header": False}
properties={"path": tmp_excel_file, "exposed_type": "numpy", "has_header": False}
)

arr_1 = np.array([[1], [2], [3]])
Expand All @@ -337,12 +337,12 @@ def test_write_without_header_multiple_sheet_numpy_without_sheet_name(tmp_excel_
assert np.array_equal(excel_dn_data[sheet_name], sheet_data[sheet_name])


def test_write_without_header_multiple_sheet_custom_exposed_type_with_sheet_name(tmp_excel_file_3):
def test_write_without_header_multiple_sheet_custom_exposed_type_with_sheet_name(tmp_excel_file):
excel_dn = ExcelDataNode(
"foo",
Scope.SCENARIO,
properties={
"path": tmp_excel_file_3,
"path": tmp_excel_file,
"sheet_name": sheet_names,
"exposed_type": MyCustomObject,
"has_header": False,
Expand All @@ -360,11 +360,11 @@ def test_write_without_header_multiple_sheet_custom_exposed_type_with_sheet_name
assert all(actual == expected for actual, expected in zip(excel_dn_data[sheet_name], sheet_data[sheet_name]))


def test_write_without_header_multiple_sheet_custom_exposed_type_without_sheet_name(tmp_excel_file_3):
def test_write_without_header_multiple_sheet_custom_exposed_type_without_sheet_name(tmp_excel_file):
excel_dn = ExcelDataNode(
"foo",
Scope.SCENARIO,
properties={"path": tmp_excel_file_3, "exposed_type": MyCustomObject, "has_header": False}
properties={"path": tmp_excel_file, "exposed_type": MyCustomObject, "has_header": False}
)

row_1 = [MyCustomObject(0, 1, "hi"), MyCustomObject(1, 2, "world"), MyCustomObject(2, 3, "text")]
Expand Down

0 comments on commit f4ee858

Please sign in to comment.