Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access name of generated report #83

Open
Michael-Steshenko opened this issue Mar 30, 2021 · 0 comments
Open

Access name of generated report #83

Michael-Steshenko opened this issue Mar 30, 2021 · 0 comments

Comments

@Michael-Steshenko
Copy link

Michael-Steshenko commented Mar 30, 2021

  • HtmlTestRunner version:
  • Python version: 3.9.2
  • Operating System: Windows 10

Description

I wan't to access the report file and do actions on it after it's generated, but there is no way I see to get the file name, it would be easy to save the file name in the runner object so it can be accessed later.

I also want to be able to know if some tests failed via code, Is there a way I'm missing?

this code is responsible for generating the file name.

def generate_file(self, testRunner, report_name, report):
        dir_to = testRunner.output
        if not os.path.exists(dir_to):
            os.makedirs(dir_to)

        if testRunner.timestamp:
            report_name += "_" + testRunner.timestamp
        report_name += ".html"

        path_file = os.path.abspath(os.path.join(dir_to, report_name))

I can implement that functionality if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant