def test_preprocessor_wrong_yaml(context):
    with pytest.raises(error.ParsingRunnableError):
        ex = SafeExecutionContext("tests/data/dummy_configs/wrong_config.yaml")
        ex.first_parse()
def test_preprocessor_none_file():
    with pytest.raises(TypeError):
        ex = SafeExecutionContext(None)
        ex.preprocess()
def test_preprocessor_non_existing_file():
    with pytest.raises(FileNotFoundError):
        ex = SafeExecutionContext("/non/existing/file")
        ex.preprocess()
def test_preprocessor_empty():
    with pytest.raises(TypeError):
        ex = SafeExecutionContext()
        ex.preprocess()
 def ex(config):
     t.write(config)
     t.flush()
     return SafeExecutionContext(t.name)