diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2021-08-05 15:13:22 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2021-08-05 15:13:22 -0400 |
commit | 6224688e4fe038c6ecaa851489c688bd6f4eb457 (patch) | |
tree | 5996a7947d7df3d496012b8986190542f96db890 | |
parent | 1f51202aec24679be776ea759efb66070100c3c3 (diff) | |
download | python-coveragepy-git-6224688e4fe038c6ecaa851489c688bd6f4eb457.tar.gz |
test: add a test of the one thing uncovered in results.py
-rw-r--r-- | tests/test_results.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_results.py b/tests/test_results.py index 02b1f963..83968956 100644 --- a/tests/test_results.py +++ b/tests/test_results.py @@ -65,6 +65,14 @@ class NumbersTest(CoverageTest): def test_display_covered(self, prec, pc, res): assert Numbers(precision=prec).display_covered(pc) == res + @pytest.mark.parametrize("prec, width", [ + (0, 3), # 100 + (1, 5), # 100.0 + (4, 8), # 100.0000 + ]) + def test_pc_str_width(self, prec, width): + assert Numbers(precision=prec).pc_str_width() == width + def test_covered_ratio(self): n = Numbers(n_files=1, n_statements=200, n_missing=47) assert n.ratio_covered == (153, 200) |