8000 Fixtureize and parametrize h5py copy tests. by QuLogic · Pull Request #417 · zarr-developers/zarr-python · GitHub
[go: up one dir, main page]

Skip to content

Fixtureize and parametrize h5py copy tests. #417

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

Merged
merged 2 commits into from
Feb 19, 2021

Conversation

QuLogic
Copy link
Contributor
@QuLogic QuLogic commented Mar 19, 2019

The main reason for this is that closing h5py files using atexit seems to be a bit buggy. If I run with pytest, it's fine, but if I use python setup.py test, it will crash on exit.

Using pytest fixtures, we can avoid atexit entirely and files will be closed at the end of the test. Unfortunately, this means unittest.TestCase cannot be used, so switch to a plain class works. With the fixture, we can parametrize zarr vs. h5py and drop the extra classes.

TODO:

  • Add unit tests and/or doctests in docstrings
  • [N/A] Add docstrings and API docs for any new/modified user-facing classes and functions
  • [N/A] New/modified features documented in docs/tutorial.rst
  • [N/A] Changes documented in docs/release.rst
  • [N/A] Docs build locally (e.g., run tox -e docs)
  • AppVeyor and Travis CI passes
  • Test coverage is 100% (Coveralls passes)

@QuLogic
Copy link
Contributor Author
QuLogic commented Mar 19, 2019

Note: most of the beginning change is just an indent-level increase so I could put the h5 file in a context manager.

@joshmoore
Copy link
Member

@QuLogic : are you still interested in taking this forward? If so, there are a few conflicts in your test changes.

@codecov
Copy link
codecov bot commented Feb 19, 2021

Codecov Report

Merging #417 (665c68c) into master (0c530c3) will increase coverage by 0.48%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #417      +/-   ##
==========================================
+ Coverage   99.45%   99.94%   +0.48%     
==========================================
  Files          28       28              
  Lines       10287    10237      -50     
==========================================
  Hits        10231    10231              
+ Misses         56        6      -50     
Impacted Files Coverage Δ
zarr/tests/test_convenience.py 100.00% <100.00%> (ø)
zarr/util.py 100.00% <0.00%> (+15.06%) ⬆️

Copy link
Member
@joshmoore joshmoore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before & After without h5py installed:

=========================== 29 passed, 45 skipped in 0.37s ===========================

Before & After with h5py installed:

================================= 74 passed in 4.89s =================================

👍

@joshmoore joshmoore merged commit f6dba5a into zarr-developers:master Feb 19, 2021
@QuLogic QuLogic deleted the param-h5py branch February 19, 2021 08:07
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
0