Opened 4 years ago

Closed 4 years ago

#5859 enhancement closed fixed (fixed)

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

Reported by: Jean-Paul Calderone Owned by: Jean-Paul Calderone
Priority: normal Milestone:
Component: trial Keywords:
Cc: Jonathan Lange Branch: branches/extra-reporter-assertions-5859
branch-diff, diff-cov, branch-cov, buildbot
Author: exarkun

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 4 years ago by DefaultCC Plugin

Cc: Jonathan Lange added

comment:2 Changed 4 years ago by Jean-Paul Calderone

Author: exarkun
Branch: branches/extra-reporter-assertions-5859

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

comment:3 Changed 4 years ago by Jean-Paul Calderone

(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 4 years ago by Jean-Paul Calderone

Keywords: review added
Owner: Jean-Paul Calderone 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 4 years ago by Julian Berman

Keywords: review removed
Owner: set to Julian Berman

comment:6 Changed 4 years ago by Julian Berman

Owner: changed from Julian Berman to Jean-Paul Calderone

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 4 years ago by Jean-Paul Calderone

Resolution: fixed
Status: newclosed

(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.