Edgewall Software
Modify

Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#13028 closed defect (fixed)

Stop unittest execution if database adapter import fails

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 1.4
Component: general Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Mentioned comment:8:ticket:12989, it would be good to stop test execution for all database types when the adapter is not installed. Doing so might require implementing a class that inherits from TestCase or TestSuite.

Attachments (0)

Change History (4)

comment:1 by Ryan J Ollos, 5 years ago

Milestone: next-major-releases1.0.19
Owner: set to Ryan J Ollos
Status: newassigned

in reply to:  description comment:2 by Ryan J Ollos, 5 years ago

Replying to Ryan J Ollos:

Doing so might require implementing a class that inherits from TestCase or TestSuite.

I'm not sure this is worth the effort to change the entire codebase in order to implement the check in setUpClass or another setup method. Also, we might benefit from switching to pytest eventually, and the effort might be better spent working on that.

Proposed change is to switch Makefile to use unittest module. The -f (fail fast) option can then be used:

$ make unittest testopts=-f

This option can also be added to Makefile.cfg.

Proposed changes: log:rjollos.git:t13028_unittest_database_adapter

DONE Update TracDev/UnitTests.

Last edited 5 years ago by Ryan J Ollos (previous) (diff)

comment:3 by Ryan J Ollos, 5 years ago

Changes don't work for Python < 2.7. According to docs,

Changed in version 2.7: In earlier versions it was only possible to run individual test methods and not modules or classes.

We could just target changes to trunk: [bdc583b84/rjollos.git]

Last edited 5 years ago by Ryan J Ollos (previous) (diff)

comment:4 by Ryan J Ollos, 5 years ago

Milestone: 1.0.191.4
Resolution: fixed
Status: assignedclosed

Command line options for unittest module: https://docs.python.org/2/library/unittest.html#command-line-options

Edited TracDev/UnitTests@28.

Committed to trunk in r17088.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.