Opened 14 years ago

Closed 14 years ago

Last modified 13 years ago

#14486 closed (fixed)

Change unittest / unittest2 import logic on trunk

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

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.

Change History (3)

comment:1 by Russell Keith-Magee, 14 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Russell Keith-Magee, 14 years ago

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

milestone: 1.3

Milestone 1.3 deleted

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