Opened 8 years ago

Closed 8 years ago

Last modified 7 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:


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.

Change History (3)

comment:1 Changed 8 years ago by Russell Keith-Magee

Triage Stage: UnreviewedAccepted

comment:2 Changed 8 years ago by Russell Keith-Magee

Resolution: fixed
Status: newclosed

(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 7 years ago by Jacob

milestone: 1.3

Milestone 1.3 deleted

Note: See TracTickets for help on using tickets.
Back to Top