Skip to content

Commit

Permalink
Fix tests and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
csala committed Jan 10, 2019
1 parent bf7a4f5 commit 1a352e0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@


tests_require = [
'mlblocks>=0.2.4',
'mlblocks>=0.3.0',
'pytest>=3.4.2',
'google-compute-engine==2.8.12', # required by travis
]
Expand Down
15 changes: 3 additions & 12 deletions tests/test_mlblocks_primitives.py → tests/test_jsons.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,10 @@

import json
import os
from unittest.mock import patch

from mlblocks import MLPipeline

PRIMITIVES_PATH = os.path.normpath(
os.path.join(
os.path.dirname(__file__),
os.pardir,
'mlblocks_primitives'
)
)

from mlprimitives import MLPRIMITIVES_JSONS_PATH

HYPERPARAMETER_DEFAULTS = {
'int': 1,
Expand All @@ -24,14 +16,13 @@
}


@patch('mlblocks.primitives._PRIMITIVES_PATHS', new=[PRIMITIVES_PATH])
def test_jsons():
"""Validate MLBlocks primitive jsons"""

primitives = (f for f in os.listdir(PRIMITIVES_PATH) if f.endswith('.json'))
primitives = (f for f in os.listdir(MLPRIMITIVES_JSONS_PATH) if f.endswith('.json'))
for primitive_filename in primitives:
try:
primitive_path = os.path.join(PRIMITIVES_PATH, primitive_filename)
primitive_path = os.path.join(MLPRIMITIVES_JSONS_PATH, primitive_filename)
with open(primitive_path, 'r') as f:
primitive = json.load(f)

Expand Down
File renamed without changes.

0 comments on commit 1a352e0

Please sign in to comment.