Skip to content

Commit

Permalink
Merge pull request #78 from ww-tech/update-pytest-version
Browse files Browse the repository at this point in the history
Update pytest version
  • Loading branch information
mskarlinski-ww authored May 8, 2020
2 parents 57d657f + 06cfde0 commit aceae80
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ numpy>=1.16.4
pandas>=0.24.0
protobuf>=3.8.0
pydot>=1.4.1
pytest~=3.10.1
pytest-cov>=2.6.0
pytest>=5.4.0
pytest-cov>=2.8.0
python-dateutil==2.8.0
PyYAML>=5.1
recommonmark>=0.6.0
Expand Down
12 changes: 7 additions & 5 deletions test/test_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
from primrose.writers.abstract_file_writer import AbstractFileWriter
from primrose.node_factory import NodeFactory

@pytest.fixture
def mock_env(monkeypatch):
monkeypatch.setenv("PRIMROSE_EXT_NODE_PACKAGE", "test")

def test_init_error0():
config = {}
with pytest.raises(Exception) as e:
Expand Down Expand Up @@ -463,7 +467,7 @@ def test_yaml_perform_any_config_fragment_substitution():
"""
assert final_str == expected

def test_class_prefix():
def test_class_prefix(mock_env):
config_path = {
"implementation_config": {
"reader_config": {
Expand Down Expand Up @@ -493,7 +497,7 @@ def test_class_prefix():
NodeFactory().unregister('TestExtNode')


def test_class_package():
def test_class_package(mock_env):
config_path = {
"metadata": {
"class_package": "test"
Expand Down Expand Up @@ -541,7 +545,7 @@ def test_class_package():
NodeFactory().unregister('TestExtNode')


def test_env_override_class_package():
def test_env_override_class_package(mock_env):
config = {
"metadata": {
"class_package": "junk"
Expand All @@ -555,12 +559,10 @@ def test_env_override_class_package():
}
}
}
os.environ['PRIMROSE_EXT_NODE_PACKAGE'] = 'test'
config = Configuration(config_location=None, is_dict_config=True, dict_config=config)
assert config.config_string
assert config.config_hash
NodeFactory().unregister('TestExtNode')
os.environ.pop('PRIMROSE_EXT_NODE_PACKAGE')


def test_incorrect_class_package():
Expand Down

0 comments on commit aceae80

Please sign in to comment.