ApprovalTests.Python icon indicating copy to clipboard operation
ApprovalTests.Python copied to clipboard

support inline approvals on cyber-dojo

Open nitsanavni opened this issue 1 year ago • 3 comments

doesn't quite work as expected yet, see here - https://cyber-dojo.org/kata/edit/b0U7pS

nitsanavni avatar Feb 11 '24 10:02 nitsanavni

experimenting with cyber-dojo + inline approvals + auto-approval https://cyber-dojo.org/kata/edit/US1feV

(almost works)

nitsanavni avatar Mar 01 '24 21:03 nitsanavni

Found the problem:

We're doing a shallow file compare (only comparing stats), and if the received is the exact length as approved we get a false positive.

https://github.com/approvals/ApprovalTests.Python/blob/2bdb007503f4863728413df996bc588c32402a60/approvaltests/file_approver.py#L26

for inline in cyber-dojo this line should be:

if filecmp.cmp(approved_path, received_path, shallow=is_not_cyber_dojo()):

see here: https://cyber-dojo.org/kata/edit/bHvRz1

nitsanavni avatar Apr 28 '24 08:04 nitsanavni

update: fixed in latest release

now waiting to be merged to cyberdojo https://github.com/cyber-dojo-languages/python-approval-pytest/pull/4 https://github.com/cyber-dojo-languages/python-approval-unittest/pull/4

nitsanavni avatar Apr 29 '24 12:04 nitsanavni