1

I am unable to connect allure plugin to pycharm, so that it can automatically generate the reports in the ./report/ directory.

I am unable to understand the https://github.com/allure-framework/allure-python above documentation, it has a line which says Connecting to IDE:

pytest_plugins = 'allure.pytest_plugin' But I am unable to understand where I need to make that change in pycharm.

Max Voitko
  • 1,542
  • 1
  • 17
  • 32
rbansal
  • 1,184
  • 14
  • 21

2 Answers2

2

Go to run>Edit Configurations>Python Tests and add this line in Additional Arguments:

--alluredir=./reports/<report-name>

Pytest requires alluredir argument to create allure report. Once the allure report is created, you can serve it by this command in terminal: allure serve reports/<report-name>

SilentGuy
  • 1,867
  • 17
  • 27
1

You need to create file py.test configuration file conftest.py. And put the string you mentioned there. Don't forget to import pytest at the top of the file.

Max Voitko
  • 1,542
  • 1
  • 17
  • 32
  • py.test is a text file contains nothing? and put `pytest_plugins = 'allure.pytest_plugin'` in the conftest.py file? – Laser Hawk Aug 29 '17 at 21:16
  • No need to create file py.test. You need only to create config file for py.test framework conftest.py. More about conftest.py https://stackoverflow.com/questions/34466027/in-py-test-what-is-the-use-of-conftest-py-files and https://docs.pytest.org/en/latest/plugins.html – Max Voitko Aug 30 '17 at 08:19