Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Prashanth Sams
    @prashanth-sams
    Welcome! this group let you throw any questions about this library (issues, doubts & clarifications, etc.,)
    tarunmudgal
    @tarunmudgal
    Hi, Currently I'm using pytest-html plugin. I saw pytest-html-reporter on GitHib and it seems interesting. Could you please help me to get some information around it to begin with.
    Prashanth Sams
    @prashanth-sams
    Hey @tarunmudgal
    Using this lib is quiet simple. Just the installation is enough pip3 install pytest-html-reporter
    you will find the html file generated under /report folder right after your pytest test run
    you can customize the folder and file name if needed; check our github repo for more details abt this
    tarunmudgal
    @tarunmudgal
    hi @prashanth-sams I did the same but I ran into an issue. Please refer below traceback-
    [03-09-2020 06:48:14 PM] [INFO] [test_runner.py] [249]: [run_pytest] starting pytest test cases execution at: 03Sep2020_18:48:14.636870
    Traceback (most recent call last):
      File "test_runner.py", line 442, in <module>
        pytest_status = run_pytest(pytest_cmdline)
      File "test_runner.py", line 251, in run_pytest
        status = pytest.main(*args, **kwargs)
      File "/Users/mtarun/vmware/code/venv_3/lib/python3.8/site-packages/_pytest/config/__init__.py", line 105, in main
        config = _prepareconfig(args, plugins)
      File "/Users/mtarun/vmware/code/venv_3/lib/python3.8/site-packages/_pytest/config/__init__.py", line 257, in _prepareconfig
        return pluginmanager.hook.pytest_cmdline_parse(
      File "/Users/mtarun/vmware/code/venv_3/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
        return self._hookexec(self, self.get_hookimpls(), kwargs)
      File "/Users/mtarun/vmware/code/venv_3/lib/python3.8/site-packages/pluggy/manager.py", line 93, in _hookexec
        return self._inner_hookexec(hook, methods, kwargs)
      File "/Users/mtarun/vmware/code/venv_3/lib/python3.8/site-packages/pluggy/manager.py", line 84, in <lambda>
        self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
      File "/Users/mtarun/vmware/code/venv_3/lib/python3.8/site-packages/pluggy/callers.py", line 203, in _multicall
        gen.send(outcome)
      File "/Users/mtarun/vmware/code/venv_3/lib/python3.8/site-packages/_pytest/helpconfig.py", line 90, in pytest_cmdline_parse
        config = outcome.get_result()
      File "/Users/mtarun/vmware/code/venv_3/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result
        raise ex[1].with_traceback(ex[2])
      File "/Users/mtarun/vmware/code/venv_3/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
        res = hook_impl.function(*args)
      File "/Users/mtarun/vmware/code/venv_3/lib/python3.8/site-packages/_pytest/config/__init__.py", line 836, in pytest_cmdline_parse
        self.parse(args)
      File "/Users/mtarun/vmware/code/venv_3/lib/python3.8/site-packages/_pytest/config/__init__.py", line 1044, in parse
        self._preparse(args, addopts=addopts)
      File "/Users/mtarun/vmware/code/venv_3/lib/python3.8/site-packages/_pytest/config/__init__.py", line 994, in _preparse
        self.known_args_namespace = ns = self._parser.parse_known_args(
      File "/Users/mtarun/vmware/code/venv_3/lib/python3.8/site-packages/_pytest/config/argparsing.py", line 146, in parse_known_args
        return self.parse_known_and_unknown_args(args, namespace=namespace)[0]
      File "/Users/mtarun/vmware/code/venv_3/lib/python3.8/site-packages/_pytest/config/argparsing.py", line 156, in parse_known_and_unknown_args
        optparser = self._getparser()
      File "/Users/mtarun/vmware/code/venv_3/lib/python3.8/site-packages/_pytest/config/argparsing.py", line 120, in _getparser
        arggroup.add_argument(*n, **a)
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/argparse.py", line 1386, in add_argument
        return self._add_action(action)
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/argparse.py", line 1590, in _add_action
        action = super(_ArgumentGroup, self)._add_action(action)
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/argparse.py", line 1400, in _add_action
        self._check_conflict(action)
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/argparse.py", line 1539, in _check_conflict
        conflict_handler(action, confl_optionals)
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/argparse.py", line 1548, in _handle_conflict_error
        raise ArgumentError(action, message % conflict_string)
    argparse.ArgumentError: argument --html: conflicting option string: --html
    Just to give you the context, I'm modifying config.option.htmlpath in conftest.py as below-
    def pytest_configure(config):
        # pick pytest-html filepath dynamically
        if not config.option.htmlpath:
            config.option.htmlpath = (
                myconfig.get("mangleYaan")
                .get("testReportPath")
                .format(timeStamp=mycache.get("test_start_timestamp"))
            )
            config.option.self_contained_html = True
    
            # updating final htmlpath to my.json
            myconfig["mangleYaan"]["testReportPath"] = config.option.htmlpath
    Prashanth Sams
    @prashanth-sams
    @tarunmudgal I think you have another html reporter installed on top of it
    https://pypi.org/project/pytest-html/
    can you try after uninstalling this lib?
    Prashanth Sams
    @prashanth-sams
    still I will take this as a bug to avoid such conflicts; @tarunmudgal can you please report the same in github issues
    tarunmudgal
    @tarunmudgal
    sure, actually I have dependency over pytest-html and cannot remove it for now. Please see if this plugin can become compatible with pytest-html. It would be of great help!
    Prashanth Sams
    @prashanth-sams
    @tarunmudgal thank you for raising it as a bug; will have it in next iteration :)
    Prashanth Sams
    @prashanth-sams
    @tarunmudgal fixed in 0.1.8. Going forward the cli will be --html-report
    Prashanth Sams
    @prashanth-sams
    Hot fix applied to the css not found issue. pull in 0.2.1 for the latest update.
    tarunmudgal
    @tarunmudgal
    okay, now would it work along with pytest-html plugin?
    tarunmudgal
    @tarunmudgal
    also, would it be posible to pass html-report from pytest_configure(config)
    Prashanth Sams
    @prashanth-sams
    @tarunmudgal Yes, it works with the pytest-html
    Yes, it should work with pytest_configure too; if you'd any troubles, please ping me here
    and get the latest version 0.2.1
    tarunmudgal
    @tarunmudgal
    Hi @prashanth-sams , I tried to use latest version 0.2.1 with pytest_configure but I saw below error-
    ...
        gen.send(outcome)
      File "/Users/mtarun/vmware/code/venv_3.7/lib/python3.7/site-packages/_pytest/terminal.py", line 803, in pytest_sessionfinish
        outcome.get_result()
      File "/Users/mtarun/vmware/code/venv_3.7/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
        raise ex[1].with_traceback(ex[2])
      File "/Users/mtarun/vmware/code/venv_3.7/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
        res = hook_impl.function(*args)
      File "/Users/mtarun/vmware/code/venv_3.7/lib/python3.7/site-packages/pytest_html/plugin.py", line 614, in pytest_sessionfinish
        report_content = self._generate_report(session)
      File "/Users/mtarun/vmware/code/venv_3.7/lib/python3.7/site-packages/pytest_html/plugin.py", line 539, in _generate_report
        prefix=summary_prefix, summary=summary, postfix=summary_postfix
      File "/Users/mtarun/vmware/code/venv_3.7/lib/python3.7/site-packages/pluggy/hooks.py", line 286, in __call__
        return self._hookexec(self, self.get_hookimpls(), kwargs)
      File "/Users/mtarun/vmware/code/venv_3.7/lib/python3.7/site-packages/pluggy/manager.py", line 93, in _hookexec
        return self._inner_hookexec(hook, methods, kwargs)
      File "/Users/mtarun/vmware/code/venv_3.7/lib/python3.7/site-packages/pluggy/manager.py", line 87, in <lambda>
        firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
      File "/Users/mtarun/vmware/code/venv_3.7/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
        return outcome.get_result()
      File "/Users/mtarun/vmware/code/venv_3.7/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
        raise ex[1].with_traceback(ex[2])
      File "/Users/mtarun/vmware/code/venv_3.7/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
        res = hook_impl.function(*args)
      File "/Users/mtarun/personal/personal_stuff/code/pytest-tests/conftest.py", line 9, in pytest_html_results_summary
        class myhtml(html):
    NameError: name 'html' is not defined
    It seems still it doesn't work with pytest-html. Even I saw for pytest_configure, config.option.htmlpath wasn't available.
    Other than above, I felt some improvement is required to add STDOUT/STDERR logs for each test case like pytest-html. If user wants to look into test execution logs, he can click on any test case and see detailed logs.
    Prashanth Sams
    @prashanth-sams
    @tarunmudgal thank you for the logs; can you please raise this in github issues
    btw, are you able to see the reports when you try without adding them in pytest_configure
    tarunmudgal
    @tarunmudgal
    yes, using command line --html-report option, it works fine.
    raised a bug for above error
    tarunmudgal
    @tarunmudgal
    Hi @prashanth-sams , please let me know if I can also contribute in this project..
    Prashanth Sams
    @prashanth-sams
    Hey @tarunmudgal, would be so glad to get you as a contributor :)
    tarunmudgal
    @tarunmudgal
    ohh that's great! please let me know if you can share some pointers to begin with.. I'll go through and we can have a sync-up later on
    Prashanth Sams
    @prashanth-sams
    @tarunmudgal I will assign some initial tasks from github issues from which you can start :)
    Prashanth Sams
    @prashanth-sams
    You need approve the collaborator request access for the contribution
    tarunmudgal
    @tarunmudgal
    yeah, I've done it.
    Prashanth Sams
    @prashanth-sams
    @tarunmudgal assigned you a couple of bugs ;)
    and if you wish to move the dev talks in slack, I would be glad to have it
    Prashanth Sams
    @prashanth-sams
    @tarunmudgal may I have your email; and twitter id if possible
    tarunmudgal
    @tarunmudgal
    sure, we can use slack. My personal email-id is tarunmudgal4u@gmail.com
    I barely use twitter
    please give me slack workspace id
    Prashanth Sams
    @prashanth-sams
    you should have received an invitation
    pytest-html-reporter.slack.com
    akansha-bst
    @akansha-bst
    Hi @prashanth-sams : I was using pytest-html before in my code and getting a basic pytest report (used to pass --html in command line). I now wanted to improve the reporting by using pytest-html-reporter. (Using --html-report in command line). But there seems to be some issue with the number of testcases in the new approach. They seem to be less than the actual number of test cases and some failed cases are completely missing. Can you help why the complete set of testcases are not visible here?!