-
Notifications
You must be signed in to change notification settings - Fork 1
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 #57 from pepkit/dev
0.12.4
- Loading branch information
Showing
6 changed files
with
30 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.12.3" | ||
__version__ = "0.12.4" |
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 |
---|---|---|
|
@@ -3,4 +3,5 @@ mock>=2.0.0 | |
pytest>=3.0.7 | ||
pyyaml>=3.12 | ||
pandas>=0.20.2 | ||
ubiquerg>=0.3 | ||
veracitools |
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,22 @@ | ||
""" Tests for subclassing EchoAttMap """ | ||
|
||
import pytest | ||
from attmap import EchoAttMap | ||
|
||
__author__ = "Vince Reuter" | ||
__email__ = "[email protected]" | ||
|
||
|
||
class _SubEcho(EchoAttMap): | ||
""" Dummy class to derive from EchoAttMap """ | ||
def __init__(self, entries=None): | ||
super(_SubEcho, self).__init__(entries) | ||
|
||
|
||
@pytest.mark.parametrize("entries", [None, {}]) | ||
def test_echo_subclass_smoke(entries): | ||
""" Superclass ctor invocation avoids infinite recursion. """ | ||
try: | ||
_SubEcho(entries) | ||
except RuntimeError as e: | ||
pytest.fail(str(e)) |
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 |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
import string | ||
import pytest | ||
from attmap import * | ||
from ubiquerg import expandpath | ||
from ubiquerg import expandpath, TmpEnv | ||
|
||
__author__ = "Vince Reuter" | ||
__email__ = "[email protected]" | ||
|
@@ -23,27 +23,6 @@ def pam(): | |
return PathExAttMap() | ||
|
||
|
||
class TmpEnv(object): | ||
""" Temporary environment variable setting. """ | ||
def __init__(self, overwrite=False, **kwargs): | ||
if not overwrite: | ||
already_set = [k for k in kwargs if os.getenv(k)] | ||
if already_set: | ||
msg = "{} variable(s) already set: {}".\ | ||
format(len(already_set), ", ".join(already_set)) | ||
raise ValueError(msg) | ||
self._kvs = kwargs | ||
|
||
def __enter__(self): | ||
for k, v in self._kvs.items(): | ||
os.environ[k] = v | ||
return self | ||
|
||
def __exit__(self, exc_type, exc_val, exc_tb): | ||
for k in self._kvs: | ||
del os.environ[k] | ||
|
||
|
||
def get_path_env_pair(perm): | ||
""" | ||
Create path-like text and mapping of variable name substitutions. | ||
|