Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve testing of containers #217

Merged
merged 10 commits into from
Dec 18, 2019
Merged

Improve testing of containers #217

merged 10 commits into from
Dec 18, 2019

Conversation

rly
Copy link
Contributor

@rly rly commented Dec 6, 2019

assertContainerEqual does not check that the name, container_source, parent, or children match - just that the other fields (which does not include name!) matches. This PR fixes that.

@codecov
Copy link

codecov bot commented Dec 6, 2019

Codecov Report

Merging #217 into dev will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##              dev    #217      +/-   ##
=========================================
+ Coverage   70.38%   70.4%   +0.01%     
=========================================
  Files          31      31              
  Lines        5920    5920              
  Branches     1389    1389              
=========================================
+ Hits         4167    4168       +1     
+ Misses       1322    1321       -1     
  Partials      431     431
Impacted Files Coverage Δ
src/hdmf/common/sparse.py 71.42% <0%> (+2.85%) ⬆️

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 aa72504...209a018. Read the comment docs.

@rly rly requested a review from a team December 6, 2019 05:33
oruebel
oruebel previously approved these changes Dec 6, 2019
@rly
Copy link
Contributor Author

rly commented Dec 18, 2019

A new change:
The unittest framework automatically tries to run abstract TestCase classes as tests. These end up getting skipped. Instead, I converted those classes to abstract mix-in classes. Actual test classes inherit from the mix-in class to use the mix-in method definitions, and they will need to override unimplemented methods. See https://stackoverflow.com/questions/4566910/abstract-test-case-using-python-unittest

This design pattern is now used in several places, most notably the change from TestMapRoundTrip to TestH5RoundTripMixin

@rly rly requested a review from a team December 18, 2019 22:03
@rly rly merged commit d2ef86e into dev Dec 18, 2019
@rly rly deleted the enh/container_check branch December 18, 2019 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants