HtmlTestRunner icon indicating copy to clipboard operation
HtmlTestRunner copied to clipboard

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

Open dragojs opened this issue 4 years ago • 1 comments

  • HtmlTestRunner version: 1.2.1
  • Python version: 3.8.6
  • Operating System: windows 10

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 avatar Feb 17 '21 14:02 dragojs

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

dragojs avatar Feb 18 '21 17:02 dragojs