Skip to content

Commit

Permalink
fix formatting from Netflix#804 (Netflix#811)
Browse files Browse the repository at this point in the history
  • Loading branch information
oavdeev authored Nov 4, 2021
1 parent e9158ba commit e778f5d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion test/core/metaflow_test/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def _flow_lines(self):
yield 0, "class %s(FlowSpec):" % self.flow_name

for var, val in self.test.CLASS_VARS.items():
yield 1, '%s = %s' % (var, val)
yield 1, "%s = %s" % (var, val)

for var, parameter in self.test.PARAMETERS.items():
kwargs = ["%s=%s" % (k, v) for k, v in parameter.items()]
Expand Down
20 changes: 11 additions & 9 deletions test/core/tests/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ class ConstantsTest(MetaflowTest):
"""

PRIORITY = 0
CLASS_VARS = {'str_const': '"this is a constant"',
'int_const': 123,
'obj_const': '[]'}
CLASS_VARS = {
"str_const": '"this is a constant"',
"int_const": 123,
"obj_const": "[]",
}

PARAMETERS = {
"int_param": {"default": 456},
Expand All @@ -21,18 +23,18 @@ class ConstantsTest(MetaflowTest):
def step_all(self):
# make sure class attributes are available in all steps
# through joins etc
assert_equals('this is a constant', self.str_const)
assert_equals("this is a constant", self.str_const)
assert_equals(123, self.int_const)
# obj_const is mutable. Not much that can be done about it
assert_equals([], self.obj_const)

assert_equals(456, self.int_param)
assert_equals('foobar', self.str_param)
assert_equals("foobar", self.str_param)

# make sure class variables are not listed as parameters
from metaflow import current
assert_equals({'int_param', 'str_param'},
set(current.parameter_names))

assert_equals({"int_param", "str_param"}, set(current.parameter_names))

try:
self.int_param = 5
Expand All @@ -50,5 +52,5 @@ def step_all(self):

def check_results(self, flow, checker):
for step in flow:
checker.assert_artifact(step.name, 'int_param', 456)
checker.assert_artifact(step.name, 'int_const', 123)
checker.assert_artifact(step.name, "int_param", 456)
checker.assert_artifact(step.name, "int_const", 123)

0 comments on commit e778f5d

Please sign in to comment.