def assert_all_changes(start_state, end_state, expected_changes):
 __tracebackhide__ = True
 start_files = start_state
 end_files = end_state
 if isinstance(start_state, TestPipResult):
  start_files = start_state.files_before
 if isinstance(end_state, TestPipResult):
  end_files = end_state.files_after
 diff = diff_states(start_files, end_files, ignore=expected_changes)
 if (list(diff.values()) != [{}, {}, {}]):
  raise TestFailure(('Unexpected changes:\n' + '\n'.join([((k + ': ') + ', '.join(v.keys())) for (k, v) in diff.items()])))
 return diff

def assert_all_changes ( start_state , end_state , expected_changes ) : __tracebackhide__ = True start_files = start_state end_files = end_state if isinstance ( start_state , TestPipResult ) : start_files = start_state . files_before if isinstance ( end_state , TestPipResult ) : end_files = end_state . files_after diff = diff_states ( start_files , end_files , ignore = expected_changes ) if ( list ( diff . values ( ) ) != [ { } , { } , { } ] ) : raise TestFailure ( ( 'Unexpected changes:\n' + '\n' . join ( [ ( ( k + ': ' ) + ', ' . join ( v . keys ( ) ) ) for ( k , v ) in diff . items ( ) ] ) ) ) return diff
fails if anything changed that isnt listed in the expected_changes .