From 20dc91d3e4626f4b788701d56480b306a1c1cb0b Mon Sep 17 00:00:00 2001 From: Artem Ryabkov Date: Mon, 7 Dec 2020 21:47:26 +0300 Subject: [PATCH] Fixed multiline custom text --- HISTORY.rst | 6 ++++++ README.rst | 2 +- pytest_telegram/plugin.py | 2 +- setup.cfg | 2 +- setup.py | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index dcc14b1..20a169b 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -6,3 +6,9 @@ History ------------------ * Initial release. + +1.0.3 +------------------ + +* Fixed multiline custom text. + diff --git a/README.rst b/README.rst index fdf65fe..a4b134f 100644 --- a/README.rst +++ b/README.rst @@ -44,7 +44,7 @@ Usage Telegram Bot token --telegram_report_url=URL Link for test report, optional - --telegram_custom_test=TEXT + --telegram_custom_text=TEXT Custom text, will be added for message, optional --telegram_success_sticker_id=FILE_ID File id of telegram sticker which will be attach to Success report diff --git a/pytest_telegram/plugin.py b/pytest_telegram/plugin.py index 7d50b08..c96346c 100644 --- a/pytest_telegram/plugin.py +++ b/pytest_telegram/plugin.py @@ -71,7 +71,7 @@ def pytest_terminal_summary(terminalreporter, exitstatus, config): success_sticker_id = config.option.success_sticker_id fail_sticker_id = config.option.fail_sticker_id report_url = f'\n{config.option.telegram_report_url}' if config.option.telegram_report_url else '' - custom_text = f'\n{config.option.telegram_custom_text}' if config.option.telegram_custom_text else '' + custom_text = f'\n{config.option.telegram_custom_text}'.replace('\\n', '\n') if config.option.telegram_custom_text else '' final_results = 'Passed=%s Failed=%s Skipped=%s Error=%s XFailed=%s XPassed=%s' % ( passed, failed, skipped, error, xfailed, xpassed) diff --git a/setup.cfg b/setup.cfg index 3d7a80b..9da5676 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.0.0 +current_version = 1.0.3 commit = True tag = True diff --git a/setup.py b/setup.py index 22d3d6d..925e70c 100644 --- a/setup.py +++ b/setup.py @@ -45,7 +45,7 @@ test_suite='tests', tests_require=test_requirements, url='https://github.com/rad96/pytest-telegram', - version='1.0.2', + version='1.0.3', zip_safe=False, entry_points={ 'pytest11': [