summaryrefslogtreecommitdiff
path: root/tests/conftest.py
diff options
context:
space:
mode:
authorkotfu <kotfu@kotfu.net>2018-08-11 19:54:10 -0600
committerkotfu <kotfu@kotfu.net>2018-08-11 19:54:10 -0600
commit1daf5d2cb63145408520f39c799425a82b2ec948 (patch)
tree5b1458aaaf54b9b740974ab14cacdb5ade4e2724 /tests/conftest.py
parent0053f18fade2f2148daf19975581e8372ca7a69b (diff)
downloadcmd2-git-1daf5d2cb63145408520f39c799425a82b2ec948.tar.gz
First pass at improved colorizing
- colors setting now allows Always, Terminal, Never values - poutput() and perror() honor these new settings
Diffstat (limited to 'tests/conftest.py')
-rw-r--r--tests/conftest.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index 3f3b862e..9ca506af 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -80,11 +80,8 @@ SHORTCUTS_TXT = """Shortcuts for other commands:
@@: _relative_load
"""
-expect_colors = True
-if sys.platform.startswith('win'):
- expect_colors = False
# Output from the show command with default settings
-SHOW_TXT = """colors: {}
+SHOW_TXT = """colors: Terminal
continuation_prompt: >
debug: False
echo: False
@@ -94,14 +91,10 @@ locals_in_py: False
prompt: (Cmd)
quiet: False
timing: False
-""".format(expect_colors)
+"""
-if expect_colors:
- color_str = 'True '
-else:
- color_str = 'False'
SHOW_LONG = """
-colors: {} # Colorized output (*nix only)
+colors: Terminal # Allow colorized output
continuation_prompt: > # On 2nd+ line of input
debug: False # Show full error stack on error
echo: False # Echo command issued into output
@@ -111,7 +104,7 @@ locals_in_py: False # Allow access to your application in py via self
prompt: (Cmd) # The prompt issued to solicit input
quiet: False # Don't print nonessential feedback
timing: False # Report execution times
-""".format(color_str)
+"""
class StdOut(object):
@@ -128,6 +121,9 @@ class StdOut(object):
def clear(self):
self.buffer = ''
+ def isatty(self):
+ return True
+
def normalize(block):
""" Normalize a block of text to perform comparison.