S
_demo_comment_pm_ai_id = pytest.fixture(lambda: rff(path=f'{GRABBED_DIR}/comment_pm_ai_id.txt'))Size: a a a
S
_demo_comment_pm_ai_id = pytest.fixture(lambda: rff(path=f'{GRABBED_DIR}/comment_pm_ai_id.txt'))ИС
BK
_demo_comment_pm_ai_id = pytest.fixture(lambda: rff(path=f'{GRABBED_DIR}/comment_pm_ai_id.txt'))BK
S
rff = lambda path: [[f.__enter__(), f.read(), f.__exit__()][1] for f in [open(path)]][0]
BK
rff = lambda path: [[f.__enter__(), f.read(), f.__exit__()][1] for f in [open(path)]][0]
S
BK
_demo_comment_pm_ai_id = pytest.fixture(lambda: rff(path=f'{GRABBED_DIR}/comment_pm_ai_id.txt'))BK
BK
_demo_comment_pm_ai_id = pytest.fixture(lambda: rff(path=f'{GRABBED_DIR}/comment_pm_ai_id.txt'))comment_pm_ai_id = pytest.fixture(lambda: rff(path=f'{GRABBED_DIR}/comment_pm_ai_id.txt'))
fresh_ai_id = pytest.fixture(lambda: rff(path=f'action_item_id.txt'))
fresh_analytic_ai_id = pytest.fixture(lambda: rff(path=f'analytic_action_item_id.txt'))
fresh_comment_id = pytest.fixture(lambda: rff(path=f'comment_ai_id.txt'))
fresh_report_id = pytest.fixture(lambda: rff(path=f'report_item_id.txt'))
fresh_detached_sensor_id = pytest.fixture(lambda: rff(path=f'detached_sensor_id.txt'))
_fresh_access_token = pytest.fixture(lambda: rff(path=f'{GRABBED_DIR}/new_user_access_token.txt'))
_fresh_user_id = pytest.fixture(lambda: rff(path=f'{GRABBED_DIR}/new_user_id.txt'))
_fresh_access_token_by_pm = pytest.fixture(lambda: rff(path=f'{GRABBED_DIR}/new_user_access_token_by_pm.txt'))
_pm_ai_id = pytest.fixture(lambda: rff(path=f'{GRABBED_DIR}/_pm_ai_id.txt'))S
S
from pytest import fixture as F и вместо pytest.fixture пиши F :)S
pytest.fixture не копипаситьИС
comment_pm_ai_id = pytest.fixture(lambda: rff(path=f'{GRABBED_DIR}/comment_pm_ai_id.txt'))
fresh_ai_id = pytest.fixture(lambda: rff(path=f'action_item_id.txt'))
fresh_analytic_ai_id = pytest.fixture(lambda: rff(path=f'analytic_action_item_id.txt'))
fresh_comment_id = pytest.fixture(lambda: rff(path=f'comment_ai_id.txt'))
fresh_report_id = pytest.fixture(lambda: rff(path=f'report_item_id.txt'))
fresh_detached_sensor_id = pytest.fixture(lambda: rff(path=f'detached_sensor_id.txt'))
_fresh_access_token = pytest.fixture(lambda: rff(path=f'{GRABBED_DIR}/new_user_access_token.txt'))
_fresh_user_id = pytest.fixture(lambda: rff(path=f'{GRABBED_DIR}/new_user_id.txt'))
_fresh_access_token_by_pm = pytest.fixture(lambda: rff(path=f'{GRABBED_DIR}/new_user_access_token_by_pm.txt'))
_pm_ai_id = pytest.fixture(lambda: rff(path=f'{GRABBED_DIR}/_pm_ai_id.txt'))BK
S
path=, и так понятно что путь к файлу :)BK
S
BK
BK
dict_file = {'comment_id': res.json()['comment']['id']}
with open(f'{GRABBED_DIR}/grabbed_data.yaml', 'w') as outfile:
yaml.dump(dict_file, outfile)