oldani / HtmlTestRunner

A Test Runner in python, for Human Readable HTML Reports
MIT License
295 stars 171 forks source link

Report displays test methods alphabetically instead of the order they were run in #81

Open dragojs opened 3 years ago

dragojs commented 3 years ago

Description

I manually added some methods from multiple TestCases. They are run in the order that I add them in, but the HTML report displays them in an alphabetical order.

What I Did

    loader = unittest.TestLoader()
    suite = unittest.TestSuite()
    suite.addTest(TestStringMethods("test_split"))
    suite.addTest(TestStringMethods("test_isupper"))
    suite.addTest(MyTestCase("test_maybe_skipped"))
    suite.addTest(MyTestCase("test_format"))

    HtmlTestRunner.HTMLTestRunner(combine_reports = True, open_in_browser = True, descriptions = False, report_title = "Report").run(suite)

image

dragojs commented 3 years ago

It appears that the TestClasses themselves are also not displayed in the order they were run; In the scenario from this pic, I added suite.addTest(TestMainMenu("test_inbox_text_when_empty")) at the bottom, after all the other tests, but It's displayed right in the middle.

image