Code

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#14486 closed (fixed)

Change unittest / unittest2 import logic on trunk

Reported by: voidspace Owned by: nobody
Component: Testing framework Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The current import logic for unittest/unittest2 is:

  • If Python 2.7 use standard library unittest
  • Try locally installed unittest2
  • Otherwise fallback to bundled unittest2

Can I suggest changing it to:

  • Try locally installed unittest2
  • If Python 2.7 use standard library unittest
  • Otherwise fallback

This allows Python 2.7 users to still upgrade to a more recent version of unittest2 and use that locally. (New features added to unittest in Python 3.2 are still being added to unittest2.) Without this Python 2.6 (and earlier) users will be able to use a locally installed unittest2 but Python 2.7 users *won't*, which seems inconsistent.

Attachments (0)

Change History (3)

comment:1 Changed 3 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 3 years ago by russellm

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

(In [14259]) Fixed #14486 -- Modified the import order for the bundled unittest so that a locally installed unittest2 (which will have more features) will supersede the Python 2.7 native version. Thanks to Michael Foord for the suggestion.

comment:3 Changed 3 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.