def test_checked_session(setup): sess = new_test_session(default=True) a = mt.ones((10, 10)) b = a + 1 b.execute() np.testing.assert_array_equal(sess.fetch(b), np.ones((10, 10)) + 1) sess.stop_server()
def test_check_subtask_processor(setup): config = load_config(CONFIG_FILE) config['subtask']['subtask_processor_cls'] = \ 'mars.deploy.oscar.tests.' \ 'test_checked_session.FakeCheckedSubtaskProcessor' sess = new_test_session(default=True, config=config) a = mt.ones((10, 10)) b = a + 1 with pytest.raises(RuntimeError, match='Premeditated'): b.execute() # test test config b.execute(extra_config={'check_all': False}) sess.stop_server()