Commit eb9145ee authored by Mathieu Giraud's avatar Mathieu Giraud

src/should.py: command-line and !OPTIONS --mod have priority over test modifiers

Closes #43.
parent 94bfdbf5
......@@ -703,6 +703,7 @@ class TestSuite():
self.skip = False
self.status = None
self.modifiers = modifiers
self.opt_modifiers = ''
self.variables = []
self.status = None
self.stats = Stats('test')
......@@ -779,8 +780,7 @@ class TestSuite():
opts, unknown = options.parse_known_args(l[len(DIRECTIVE_OPTIONS):].split())
self.variables = populate_variables(opts.var) + self.variables
self.variables_all = self.variables + variables
if opts.mod:
self.modifiers += ''.join(opts.mod)
self.opt_modifiers = ''.join(opts.mod) if opts.mod else ''
continue
# Directive -- Exit code
......@@ -806,7 +806,7 @@ class TestSuite():
if RE_TEST.search(l):
pos = l.find(TOKEN_TEST)
modifiers, expression = l[:pos], l[pos+1:]
test = TestCase(self.modifiers + modifiers, expression, name)
test = TestCase(modifiers + self.opt_modifiers + self.modifiers, expression, name)
current_tests.append(test)
self.tests.append(test)
continue
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment