earthlab / matplotcheck

A python package for checking and testing matplotlib plots. We use this for autograding student assignments but there are many other potential use cases including package testing (for packages with plots)!
https://matplotcheck.readthedocs.io
BSD 3-Clause "New" or "Revised" License
18 stars 8 forks source link

Autograde tests #224

Closed nkorinek closed 4 years ago

nkorinek commented 4 years ago

Added pytest tests for the autograde module!

nkorinek commented 4 years ago

@lwasser so this is a weird bug that's causing this to fail. For some reason, the tests I wrote for the autograde wrapper are causing tests that rely on the pytest fixture pt_hist in the file test_base_data to fail. It is giving it 106 bins instead of 6 bins. In my new tests, I never touch that fixture or that file at all. If I rename my file so that it is run after test_base_data, everything passes. But there should be a more elegant solution than that, right? Any idea what's going on here? Thanks!

codecov[bot] commented 4 years ago

Codecov Report

Merging #224 into master will increase coverage by 1.70%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #224      +/-   ##
==========================================
+ Coverage   77.61%   79.32%   +1.70%     
==========================================
  Files          18       19       +1     
  Lines        1747     1775      +28     
==========================================
+ Hits         1356     1408      +52     
+ Misses        391      367      -24     
Impacted Files Coverage Δ
matplotcheck/tests/test_autograde.py 100.00% <100.00%> (ø)
matplotcheck/tests/test_base_data.py 100.00% <100.00%> (ø)
matplotcheck/autograde.py 100.00% <0.00%> (+100.00%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c948af0...8c87aa9. Read the comment docs.

nkorinek commented 4 years ago

@lwasser fixed all formatting issues and this is ready for review!

nkorinek commented 4 years ago

@lwasser all green on CI

lwasser commented 4 years ago

this addressed issue #105