Opened 2 years ago

Closed 2 years ago

#5859 enhancement closed fixed (fixed)

Add more important assertions to twisted/trial/test/test_tests.py

Reported by: exarkun Owned by: exarkun
Priority: normal Milestone:
Component: trial Keywords:
Cc: jml Branch: branches/extra-reporter-assertions-5859
(diff, github, buildbot, log)
Author: exarkun Launchpad Bug:

Description

Many of the tests in test_tests.py operate by running a suite and then making assertions on the results/reporter object. Some of these tests skip checking certain parts of the reporter's state, though, which potentially allows a broken implementation to pass them.

The tests should have a few more assertions added to make sure a properly working implementation is really in use.

This is split off of #5853.

Change History (7)

comment:1 Changed 2 years ago by DefaultCC Plugin

  • Cc jml added

comment:2 Changed 2 years ago by exarkun

  • Author set to exarkun
  • Branch set to branches/extra-reporter-assertions-5859

(In [35170]) Branching to 'extra-reporter-assertions-5859'

comment:3 Changed 2 years ago by exarkun

(In [35171]) Add a few extra assertions to some existing test methods. Also add missing docstrings, cleanup whitespace, and fix test names.

refs #5859

comment:4 Changed 2 years ago by exarkun

  • Keywords review added
  • Owner exarkun deleted

Okay, made those improvements. There's surely more that could be done here, like unifying the logic for asserting a particular result, rather than repeating the same (or, more often than not, not quite the same) group of 5 or 8 individual assertions. But I added the extra coverage I wanted, at least, and made some other minor cleanups as well.

Build results

comment:5 Changed 2 years ago by Julian

  • Keywords review removed
  • Owner set to Julian

comment:6 Changed 2 years ago by Julian

  • Owner changed from Julian to exarkun

Hello :).

There's a typo in TestSkipClasses's test_results test method (a doubled period). Other than that, what's here looks fine :).

comment:7 Changed 2 years ago by exarkun

  • Resolution set to fixed
  • Status changed from new to closed

(In [35176]) Merge extra-reporter-assertions-5859

Author: exarkun
Reviewer: Julian
Fixes: #5859

Expand the test coverage for what is done to the test results object passed in to
a trial test suite. Also, clean up a few other minor issues such as whitespace and
docstrings.

Note: See TracTickets for help on using tickets.