2

I am having an issue to pack pytest with pytest_html module to an executable using pyinstaller On Windows.

When running it with Python it does work, but I need to pack it as exe.

My example code:

import pytest
import pytest_html

def test_hello():
    assert True

pytest.main(["-p", "pytest_html","-vvv", "--capture=tee-sys","--html=report.html", __file__])

Also Tied with pytest.main(["-vvv","--html=report.html", __file__], plugins=[pytest_timeout])

The Pyinstaller command I am running is: pyinstaller --noconfirm --onefile --nowindow --exclude-module PyQt5 --log-level DEBUG -n py_exe file.py

Also tried adding it as a hidden module with no luck.

The result I am getting is: error: unrecognized arguments: --html=report.html

Looking at Analysis-00.toc, I can see the module : ('pytest_html', 'c:\\users\\nathan\\appdata\\local\\programs\\python\\python38-32\\lib\\site-packages\\pytest_html\\__init__.py', 'PYMODULE')

Versions: Windows 10, Python 3.8.3, pytest 5.4.3, pytest-html 2.1.1, pyinstaller 3.6


EDIT: Issue was fixed, see https://github.com/pyinstaller/pyinstaller/issues/5016

Avi Uziel
  • 3
  • 1
NathanK
  • 21
  • 1

0 Answers0