Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Tweak coverage #8036
Conversation
|
Oh goody, we had two tests with the same name, so only the second ran (luckily it now succeeds here, and it's only a smoke test). Anyone know a good way to check for this within our test suite--besides checking files with seemingly low test coverage %? |
|
More fun:
|
|
For top-level functions, this is relatively easy:
For class methods, maybe a short Python script: import sys
from collections import Counter
for name in sys.argv[1:]:
methods = Counter()
class_name = None
with open(name, 'r') as f:
for line in f:
if line.startswith('class'):
class_name = line.split()[1].split('(')[0].strip()
elif line.startswith('def'):
class_name = None
elif class_name and line.startswith(' def'):
method_name = line.split()[1].split('(')[0].strip()
methods[class_name + '.' + method_name] += 1
duplicates = [name for name, count in methods.most_common() if count != 1]
if duplicates:
print(name, duplicates)
|
|
For top-level classes, too:
|
tacaswell
added this to the
2.1 (next point release)
milestone
Feb 7, 2017
|
I am |
| @@ -158,7 +158,7 @@ def test_contour_manual_labels(): | ||
| @image_comparison(baseline_images=['contour_labels_size_color'], | ||
| extensions=['png'], remove_text=True) | ||
| -def test_contour_manual_labels(): | ||
| +def test_contour_labels_size_color(): | ||
dstansby
Feb 7, 2017
Contributor
Travis is failing on this image comparison. I'm guessing this just needs an updated image, since it's been a while since this test was ever run.
dopplershift
Feb 7, 2017
Contributor
Updated. Surprisingly, that's the only test that had that problem. The other newly activated tests pass, thankfully.
phobson
Feb 13, 2017
Member
How are we handling regenerating images as a policy?
See #7905
I think we'll shortly have to revert this changed image when/if #7970 is merged.
dopplershift
added some commits
Feb 6, 2017
|
It's been a good exercise. All of the test files with significant uncovered lines were caused by either dead code or tests that weren't running. I noticed a significant number of uncovered lines left are caused by |
dopplershift
added some commits
Feb 7, 2017
|
Another question: Currently, our |
|
I think both solutions are fine, with a slight preference in keeping it. |
| @@ -1464,7 +1488,8 @@ def _as_mpl_axes(self): | ||
| ax_via_gca = plt.gca(projection=prj2) | ||
| assert ax_via_gca is not ax | ||
| assert ax.get_theta_offset() == 0, ax.get_theta_offset() | ||
| - assert ax_via_gca.get_theta_offset() == np.pi, ax_via_gca.get_theta_offset() | ||
| + assert ax_via_gca.get_theta_offset() == np.pi, \ |
| - assert xax._major_tick_kw['tick2On'] == True | ||
| - assert xax._minor_tick_kw['tick1On'] == False | ||
| - assert xax._minor_tick_kw['tick2On'] == True | ||
| + assert not xax._major_tick_kw['tick1On'] |
tacaswell
Feb 9, 2017
Owner
These are slightly different tests as assert 'aardvark' passes, but assert 'aardvark' == True does not.
Do we care about this change?
|
Anyone have opinions on whether we should be ignoring
|
|
I don't think we should skip |
|
I think a lot of these are stubs in interfaces in the tests. I'm leaning towards turning them into some variety of |
tacaswell
referenced
this pull request
Feb 20, 2017
Closed
Rename duplicate test class name in test_ticker #8113
dstansby
approved these changes
Feb 20, 2017
Looks good.
re. the new test image, the image would/should have been regenerated a while ago, so adding it even if it'll be changed soon seems fine to me.
dopplershift commentedFeb 7, 2017
Mainly to turn on coverage for all testing on AppVeyor, as well as tighten our expected threshold for the test lines.
WIP because I want to investigate some of the test files that aren't at 100%.