Skip to content

Commit 88bbbd3

Browse files
thatrandomasiandevGui-FernandesBR
authored andcommitted
TST: fix pylint W1113 in MonteCarlo append rollback mock (#1110)
1 parent 27d674d commit 88bbbd3

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎tests/unit/simulation/test_monte_carlo.py‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,13 @@ def test_append_simulation_record_rolls_back_inputs_on_output_failure(tmp_path):
105105
original_open = builtins.open
106106
output_path = os.fspath(output_file)
107107

108-
def failing_output_open(file, mode="r", *args, **kwargs):
108+
def failing_output_open(*args, **kwargs):
109+
# Match builtins.open call shapes without keyword-before-vararg (W1113).
110+
file = args[0] if args else kwargs["file"]
111+
mode = args[1] if len(args) > 1 else kwargs.get("mode", "r")
109112
if os.fspath(file) == output_path and "a" in mode:
110113
raise OSError("no space left on device")
111-
return original_open(file, mode, *args, **kwargs)
114+
return original_open(*args, **kwargs)
112115

113116
with pytest.raises(OSError, match="no space left on device"):
114117
with patch("builtins.open", side_effect=failing_output_open):

0 commit comments

Comments
 (0)