-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #407 from drdavella/strict-context-handler
Disallow access to tree when file handle is closed
- Loading branch information
Showing
8 changed files
with
103 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Licensed under a 3-clause BSD style license - see LICENSE.rst | ||
# -*- coding: utf-8 -*- | ||
|
||
import pytest | ||
import numpy as np | ||
|
||
|
||
@pytest.fixture | ||
def small_tree(): | ||
x = np.arange(0, 10, dtype=np.float) | ||
tree = { | ||
'science_data': x, | ||
'subset': x[3:-3], | ||
'skipping': x[::2], | ||
'not_shared': np.arange(10, 0, -1, dtype=np.uint8) | ||
} | ||
return tree | ||
|
||
|
||
@pytest.fixture | ||
def large_tree(): | ||
# These are designed to be big enough so they don't fit in a | ||
# single block, but not so big that RAM/disk space for the tests | ||
# is enormous. | ||
x = np.random.rand(256, 256) | ||
y = np.random.rand(16, 16, 16) | ||
tree = { | ||
'science_data': x, | ||
'more': y | ||
} | ||
return tree |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters