[sqlalchemy] Re: Assert ResultProxy

2019-12-02 Thread sumau
Thanks! And to show the differences more clearly: for tag, i1, i2, j1, j2 in sm.get_opcodes(): if tag == 'replace': for i in range(i1,i2): print (seq1[i]) print (seq2[i]) Soumaya On Monday, 2 December 2019 16:54:16 UTC, Steven James wrote: > > In case you

[sqlalchemy] Re: Assert ResultProxy

2019-12-02 Thread Steven James
In case you want more details about the differences, you could also use difflib... from difflib import SequenceMatcher seq1 = [tuple(row.values()) for row in resultproxy1] seq2 = [tuple(row.values()) for row in resultproxy2] sm = SequenceMatcher(a=seq1, b=seq2, autojunk=False)

Re: [sqlalchemy] Re: Assert ResultProxy

2019-11-29 Thread Mike Bayer
On Fri, Nov 29, 2019, at 9:13 AM, sumau wrote: > Hello > > I think my original question was too generic so rephrasing... Is there a way > in sqlalchemy to: > 1. Assert a ResultProxy against an expected ResultProxy (or list of > RowProxies against expected list of RowProxies) > 2. Show any

[sqlalchemy] Re: Assert ResultProxy

2019-11-29 Thread sumau
Hello I think my original question was too generic so rephrasing... Is there a way in sqlalchemy to: 1. Assert a ResultProxy against an expected ResultProxy (or list of RowProxies against expected list of RowProxies) 2. Show any differences I wanted to check first before writing my