Opened 16 years ago

Closed 15 years ago

#1646 enhancement closed fixed (fixed)

trial should support color output on win32 as well

Reported by: Glyph Owned by:
Priority: highest Milestone:
Component: trial Keywords: win32
Cc: teratorn, Jean-Paul Calderone, Jonathan Lange Branch:
Author:

Description

It's useless fluff, but hey, it should be portable useless fluff.

I will attach some stuff.

Attachments (2)

colortrial.png (5.0 KB) - added by Glyph 16 years ago.
colortrial.py (1.0 KB) - added by Glyph 16 years ago.

Download all attachments as: .zip

Change History (19)

Changed 16 years ago by Glyph

Attachment: colortrial.png added

Changed 16 years ago by Glyph

Attachment: colortrial.py added

comment:1 Changed 16 years ago by Jonathan Lange

Keywords: win32 added

comment:2 Changed 16 years ago by Jonathan Lange

I don't have a win32 machine, so I don't really know what to do with this.

comment:3 Changed 16 years ago by Jonathan Lange

Cc: teratorn added

I've decided what to do with this.

Give me access to a win32 development machine.

comment:4 Changed 15 years ago by Jonathan Lange

Status: newassigned

comment:5 Changed 15 years ago by teratorn

Done!

comment:6 Changed 15 years ago by Jonathan Lange

Keywords: review added
Priority: normalhighest

Ready for review in source:branches/win32color-1646

comment:7 Changed 15 years ago by Jonathan Lange

Owner: changed from Jonathan Lange to teratorn
Status: assignednew

comment:8 Changed 15 years ago by teratorn

Keywords: review removed
Owner: changed from teratorn to Jonathan Lange

Review OK - makes sense and works in my test environments.

comment:9 Changed 15 years ago by Jonathan Lange

Resolution: fixed
Status: newclosed

(In [17733]) Make Trial work with color on win32 platforms.

  • Author: jml
  • Reviewer: teratorn
  • Fixes #1646

Extracts the color stuff from TreeReporter into separate classes. This makes it easy to add color support for exotic platforms like windows.

Before this branch, if a terminal had no color support, Trial fell back to the VerboseTextReporter. Now, it will still use the TreeReporter -- it will just print without colour.

comment:10 Changed 15 years ago by Jean-Paul Calderone

Cc: Jean-Paul Calderone Jonathan Lange added

There was not even one docstring or unit test added in this branch :(

comment:11 Changed 15 years ago by Jean-Paul Calderone

(In [17758]) Revert r17733 - basic functionality regression

Refs #1646

Reporting of cleanup errors results in an unhandled exception in trial when using the colorized reporter with this changeset.

comment:12 Changed 15 years ago by Jean-Paul Calderone

Resolution: fixed
Status: closedreopened

comment:13 Changed 15 years ago by Jonathan Lange

Keywords: review added
Owner: changed from Jonathan Lange to teratorn
Status: reopenednew

Fixed the failure, added a test and some docstrings.

comment:14 Changed 15 years ago by Jean-Paul Calderone

Owner: changed from teratorn to Jean-Paul Calderone
Status: newassigned

comment:15 Changed 15 years ago by Jean-Paul Calderone

Keywords: review removed
Owner: changed from Jean-Paul Calderone to Jonathan Lange
Status: assignednew

For MockColorizer, wouldn't it be simpler to keep a list of two-tuples instead of a StringIO of formatted data? Then all the string splitting in test_cleanupError can be removed.

Isn't test_reporter.suppressWarnings(foo) the same as twisted.internet.util.suppressWarnings([twisted.trial.util.suppress(category=foo)])?

In any case, the import should be outside the definition rather than inside. Likewise for _AnsiColorizer.supported's imports of sys and os.

colorizer.supported and colorizer.write are part of an internal interface, but it's one a future maintainer might want to implement or expand - add docstrings for these, please.

_AnsiColorizer.write interpolates literal strings ('\x1b['). Not wrong, but weird, since it also includes parts of the ecma control sequence in the format string.

Thanks for adding the test. Also, the change from self.GREEN to self.SUCCESS etc is nice. :)

comment:16 Changed 15 years ago by Jonathan Lange

Resolution: fixed
Status: newclosed

(In [17781]) Make Trial work with color on win32 platforms.

  • Author: jml
  • Reviewers: exarkun, teratorn
  • Fixes #1646

Extracts the color stuff from TreeReporter into separate classes. This makes it easy to add color support for exotic platforms like windows.

Before this branch, if a terminal had no color support, Trial fell back to the VerboseTextReporter. Now, it will still use the TreeReporter -- it will just print without colour.

UPDATE: Fixed the regression by adding a test (yay!). Also added docstrings and cleaned things up a little.

comment:17 Changed 11 years ago by <automation>

Owner: Jonathan Lange deleted
Note: See TracTickets for help on using tickets.