pytest-html icon indicating copy to clipboard operation
pytest-html copied to clipboard

Gettting this - AttributeError: 'Namespace' object has no attribute 'htmlpath'

Open Harshithkumar opened this issue 2 years ago • 2 comments

/Library/Frameworks/Python.framework/Versions/3.8/bin/python3 "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pycharm/_jb_pytest_runner.py" --target test_WTW.py::Test_WTW.test_cast_icon Testing started at 1:39 PM ... Launching pytest with arguments test_WTW.py::Test_WTW::test_cast_icon in /Users/hakumar/pythonProject/AppiumAndroid/tests /Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pycharm/_jb_pytest_runner.py:28: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.

if version.LooseVersion(pytest.version) >= version.LooseVersion("6.0"): INTERNALERROR> Traceback (most recent call last): INTERNALERROR> File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_pytest/config/init.py", line 1104, in getoption INTERNALERROR> val = getattr(self.option, name) INTERNALERROR> AttributeError: 'Namespace' object has no attribute 'htmlpath' INTERNALERROR> INTERNALERROR> During handling of the above exception, another exception occurred: INTERNALERROR> INTERNALERROR> Traceback (most recent call last): INTERNALERROR> File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_pytest/main.py", line 202, in wrap_session INTERNALERROR> config._do_configure() INTERNALERROR> File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_pytest/config/init.py", line 773, in _do_configure INTERNALERROR> self.hook.pytest_configure.call_historic(kwargs=dict(config=self)) INTERNALERROR> File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/hooks.py", line 308, in call_historic INTERNALERROR> res = self._hookexec(self, self.get_hookimpls(), kwargs) INTERNALERROR> File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/manager.py", line 93, in _hookexec INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs) INTERNALERROR> File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/manager.py", line 84, in INTERNALERROR> self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall( INTERNALERROR> File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/callers.py", line 208, in _multicall INTERNALERROR> return outcome.get_result() INTERNALERROR> File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result INTERNALERROR> raise ex[1].with_traceback(ex[2]) INTERNALERROR> File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall INTERNALERROR> res = hook_impl.function(*args) INTERNALERROR> File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/appiumbase/plugins/pytest_plugin.py", line 242, in pytest_configure INTERNALERROR> ab_config.pytest_html_report = config.getoption("htmlpath") # --html=FILE INTERNALERROR> File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_pytest/config/init.py", line 1115, in getoption INTERNALERROR> raise ValueError("no option named %r" % (name,)) INTERNALERROR> ValueError: no option named 'htmlpath'

Process finished with exit code 3

Empty suite

Harshithkumar avatar Apr 05 '23 08:04 Harshithkumar

this is how my requirement.txt file looks

pytest==4.6.11 Appium-Python-Client==1.0.2 selenium==3.141.0 driver==0.1.0 ===========**

Harshithkumar avatar Apr 05 '23 08:04 Harshithkumar

It doesn't look like you have pytest-html installed.

Also that's a pretty old version of pytest (current is 7.2.x).

I would suggest installing 4.0.0rc1 of pytest-html and see if that solves it (which requires pytest 7 or later).

BeyondEvil avatar Apr 05 '23 17:04 BeyondEvil