Skip to content

Conversation

@sirex
Copy link

@sirex sirex commented Jun 14, 2017

Part, where slow tests are printed, where not cevered with tests. Added tests
for that.

In rare cases, when time of two test cases are the same, sorted function lookes
to the next element of tuple, and next element is test instance which is not
orderable. And that rare case it gives following error:

    Traceback (most recent call last):
      File "CoverageTestRunner.py", line 312, in <module>
          run()
      File "CoverageTestRunner.py", line 303, in run
          result = runner.run()
      File "CoverageTestRunner.py", line 265, in run
          for secs, test in sorted(result.timings)[-10:]:
    TypeError: unorderable types: FooTests() < FooTests()

The fix was to always sort only by time, not by whole tuple.

Part, where slow tests are printed, where not cevered with tests. Added tests
for that.

In rare cases, when time of two test cases are the same, sorted function lookes
to the next element of tuple, and next element is test instance which is not
orderable. And that rare case it gives following error:

    Traceback (most recent call last):
      File "CoverageTestRunner.py", line 312, in <module>
          run()
      File "CoverageTestRunner.py", line 303, in run
          result = runner.run()
      File "CoverageTestRunner.py", line 265, in run
          for secs, test in sorted(result.timings)[-10:]:
    TypeError: unorderable types: FooTests() < FooTests()

The fix was to always sort only by time, not by whole tuple.
Copy link
Member

@mgedmin mgedmin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Successfully merging this pull request may close these issues.

3 participants