Commit Graph

4 Commits

Author SHA1 Message Date
Pradyun Gedam 54722aa7ec
Remove unused imports 2018-06-13 13:17:30 +05:30
Pradyun Gedam 5a8b11cbe4
Improve --no-color and test for it (#4866)
* Improve the --no-color test
* Let the logger decide to not color things
* misc: Move handler name outside dict
2017-11-20 17:18:13 +05:30
Pradyun Gedam ce146f6666
tests: don't check the actual sequence in test 2017-11-06 00:52:36 +05:30
Oz N Tiram 4370a5a37b Add a global option to disable colors (#4739)
* Add a global option to disable colors

 This is a fix for issue #2449

 All it does is simply add a global option --no-color

 Internally it switches ColorizedStreamHandler to StreamHandler if
 this flag is detected.

* Fix lint errors

 * not sure it makes the code more readable though ...

* Fix typo

* Choose logging class before assigning

 * As requested per review
 * Make the code shorter and easier to follow

* Be polite to followers, add commas

* Add functional test for the --no-color output

* Better detection of windows

* Fix fragile tests - can't trust script --quiet

 * The version found in Travis-CI does not respect this flag
   It added a prefix line and suffix line found if one does not
   add the flag --quiet (script from util-linux 2.26.2).

   As such the out  put is:

     Script started on Fri 27 Oct 2017 07:17:30 AM CEST
     \x1b[31mCannot uninstall requirement noSuchPackage, not installed\x1b[0m\n

     Script done on Fri 27 Oct 2017 07:17:31 AM CEST

  With this change, the test should pass, and is hopefully more stable.

* Simplify testing for color or no-color
2017-11-05 15:23:57 +05:30