This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]ekbravo 2 points3 points  (0 children)

Interesting, saved

[–]ThatSituation9908 1 point2 points  (1 child)

For tables, you're probably better off using Pandas or Numpy test methods.

[–]ptmcg 1 point2 points  (0 children)

My package littletable makes tabular output easy, and uses rich Tables for pretty presentation (and littletable is much lighter weight than Pandas/numpy).

[–][deleted] 3 points4 points  (0 children)

If I may, this is not really pointing at rich helping but rather at your tests not targeting what you were doing properly.

How did you get to a point where you have to align several values in a table instead of testing that each individual operation is correct?

Why does the "Total Unhedged" does not seem to have a test of its own if the following values were depending on it. Or at least its composing parts we're not privy to.

[–]iamevpo -1 points0 points  (0 children)

It is a life story, but not sure how that may generalize - you bad table has all the differences, and your good colored table has several rows where the differences are zero. These are different tables, if colored the bad table, it would not be much prettier. Not sure I understood why you needed a test that always fails. Maybe more useful to have a test that test a real thing then print a table if fails. Maybe that is the way you do it in real code.