Example #1
0
def test_engine_switch():
    execution_engine.put("Test")
    assert EngineDispatcher.get_engine() == PandasOnTestFactory
    assert EngineDispatcher.get_engine().io_cls == "Foo"
    execution_engine.put("Python")  # revert engine to default

    partition_format.put("Test")
    assert EngineDispatcher.get_engine() == TestOnPythonFactory
    assert EngineDispatcher.get_engine().io_cls == "Bar"
    partition_format.put("Pandas")  # revert engine to default
Example #2
0
def test_engine_wrong_factory():
    with pytest.raises(FactoryNotFoundError):
        execution_engine.put("BadEngine")
    execution_engine.put("Python")  # revert engine to default