Skip to content

Commit

Permalink
pytest compliance
Browse files Browse the repository at this point in the history
  • Loading branch information
Mickus Timothee committed Oct 2, 2023
1 parent 88691ae commit e5e3534
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mammoth/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
mammoth.opts._add_train_general_opts(parser)

# -data option is required, but not used in this test, so dummy.
opts = parser.parse_known_args(['-tasks', 'dummy', '-node_rank', '0', '-model_dim', '500'])[0]
opts = parser.parse_known_args(['-tasks', 'dummy', '-node_rank', '0', '-model_dim', '500'], strict=False)[0]


class TestModel(unittest.TestCase):
Expand Down
6 changes: 3 additions & 3 deletions mammoth/utils/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,9 @@ def defaults(cls, *args):
defaults = dummy_parser.parse_known_args([])[0]
return defaults

def parse_known_args(self):
opts, unknown = super().parse_known_args()
if unknown:
def parse_known_args(self, *args, strict=True, **kwargs):
opts, unknown = super().parse_known_args(*args, **kwargs)
if strict and unknown:
raise ValueError(f'unknown arguments provided:\n{unknown}')
return opts, unknown

Expand Down

0 comments on commit e5e3534

Please sign in to comment.