File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1
1
from __future__ import annotations
2
2
3
+ import copy
3
4
import dataclasses
4
5
import graphlib
5
6
import textwrap
6
7
import typing
8
+ import warnings
7
9
from collections .abc import Mapping , Set
8
10
from typing import Any , TypeVar
9
11
@@ -211,13 +213,18 @@ def process(
211
213
212
214
# Keep track of which checks have been completed
213
215
completed : dict [str , str | None ] = {}
216
+ fixtures_copy = copy .deepcopy (fixtures )
214
217
215
218
# Run all the checks in topological order based on their dependencies
216
219
ts = graphlib .TopologicalSorter (graph )
217
220
for name in ts .static_order ():
218
221
if all (completed .get (n , "" ) == "" for n in graph [name ]):
219
- result = apply_fixtures ({"name" : name , ** fixtures }, tasks [name ].check )
222
+ result = apply_fixtures ({"name" : name , ** fixtures_copy }, tasks [name ].check )
220
223
completed [name ] = process_result_bool (result , tasks [name ], name )
224
+ if fixtures != fixtures_copy :
225
+ fixtures_copy = copy .deepcopy (fixtures )
226
+ msg = f"{ name } modified the input fixtures! Making a deepcopy to fix and continue."
227
+ warnings .warn (msg , stacklevel = 1 )
221
228
else :
222
229
completed [name ] = None
223
230
You can’t perform that action at this time.
0 commit comments