def test_custom_get_condition_not_necessary(tmpdir, mocker, psiturk_test_client): import sys sys.path.append(os.getcwd()) import custom reload(custom) app = psiturk_test_client() from psiturk.experiment import get_condition assert get_condition('') == (0, 0)
def test_custom_get_condition_can_import(mocker, psiturk_test_client): # pytest.set_trace() # import psiturk.experiment import sys sys.path.append(os.getcwd()) import custom reload(custom) mocker.patch.object(custom, 'custom_get_condition', lambda mode: (9, 9), create=True) app = psiturk_test_client() from psiturk.experiment import get_condition assert get_condition('') == (9, 9)