Skip to content
Snippets Groups Projects
Commit 2006c954 authored by Bert Palm's avatar Bert Palm 🎇
Browse files

fixed checkConfig, fixed tests

parent 7a492375
No related branches found
No related tags found
No related merge requests found
......@@ -24,8 +24,8 @@ def checkConfig(config_df, data, flags, flagger, nodata):
_raise(config_row, SyntaxError,
f"non-optional column '{F.VARNAME}' is missing")
test_fields = config_row.filter(regex=F.TESTS)
if test_fields.isna().all():
test_fields = config_row.filter(regex=F.TESTS).dropna()
if test_fields.empty:
_raise(config_row, SyntaxError,
f"at least one test needs to be given for variable")
......
......@@ -99,9 +99,12 @@ def test_missingVariable(flagger):
]
metafobj, meta = initMetaDict(metadict, data)
pdata, pflags = runner(metafobj, flagger, data)
assert (pdata.columns == [var]).all()
try:
pdata, pflags = runner(metafobj, flagger, data)
except NameError:
pass
else:
raise AssertionError('config checker should find this')
@pytest.mark.parametrize("flagger", TESTFLAGGER)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment