check.export_TAP() now accepts list of details or single detail
ClosedPublic

Authored by lbrabec on Jun 5 2014, 11:03 AM.

Details

Summary

Function export_TAP() from check.py now accepts list of CheckDetail of single CheckDetail. If single detail is passed, it creates list with one element.

Test Plan

$ py.test -F

Diff Detail

Repository
rLTRN libtaskotron
Lint
Lint Skipped
Unit
Unit Tests Skipped
lbrabec retitled this revision from to check.export_TAP() now accepts list of details or single detail.Jun 5 2014, 11:03 AM
lbrabec updated this object.
lbrabec edited the test plan for this revision. (Show Details)
lbrabec added a reviewer: kparal.
lbrabec updated this revision to Diff 358.Jun 5 2014, 12:51 PM
  • exporting empty TAP now creates output with range 0..0
kparal requested changes to this revision.Jun 5 2014, 1:07 PM

It's OK, but please change the unreadable code.

libtaskotron/check.py
247–248

Iterable is a bit more precise term than list

292–293

Ugly vugly!
1 if check_details or 0

This revision now requires changes to proceed.Jun 5 2014, 1:07 PM
lbrabec updated this revision to Diff 362.Jun 6 2014, 7:21 AM
  • some polishing
tflink added inline comments.Jun 9 2014, 2:24 PM
libtaskotron/check.py
292

I don't understand why this could produce a 0..N. By my reading of the TAP13 Spec, the test case count declaration always starts with 1.

We want export_TAP() to be able to handle empty list properly.
The export looked like:

TAP version 13
1..0

@kparal suggested, that 0..0 would be more readable. I disscussed this with @jskladan and I was told that both 1..0 and 0..0 is acceptable.

lbrabec updated this revision to Diff 373.Jun 10 2014, 8:48 AM
  • Empty list produces range 1..0 (TAP spec)
kparal accepted this revision.Jun 10 2014, 8:50 AM

After carefully studying the spec, it is explicitly written there that we should produce 1..0 in this case. Good catch.

This revision is now accepted and ready to land.Jun 10 2014, 8:50 AM
lbrabec closed this revision.Jun 10 2014, 8:56 AM
lbrabec updated this revision to Diff 375.

Closed by commit rLTRNdcd65b3d23b7 (authored by @lbrabec).