Skip to content

Commit 6279103

Browse files
committed
Update output on Linux
1 parent af62d15 commit 6279103

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

seleniumbase/plugins/pytest_plugin.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
""" This is the pytest configuration file """
2+
""" This is the pytest configuration file for setting test options. """
33

44
import colorama
55
import os
@@ -69,11 +69,17 @@ def pytest_addoption(parser):
6969
--visual-baseline (Set the visual baseline for Visual/Layout tests.)
7070
--timeout-multiplier=MULTIPLIER (Multiplies the default timeout values.)
7171
"""
72-
colorama.init(autoreset=True)
73-
c1 = colorama.Fore.BLUE + colorama.Back.LIGHTCYAN_EX
74-
c2 = colorama.Fore.BLUE + colorama.Back.LIGHTGREEN_EX
75-
c3 = colorama.Fore.MAGENTA + colorama.Back.LIGHTYELLOW_EX
76-
cr = colorama.Style.RESET_ALL
72+
c1 = ""
73+
c2 = ""
74+
c3 = ""
75+
cr = ""
76+
if "linux" not in sys.platform:
77+
# This will be seen when typing "pytest --help" on the command line.
78+
colorama.init(autoreset=True)
79+
c1 = colorama.Fore.BLUE + colorama.Back.LIGHTCYAN_EX
80+
c2 = colorama.Fore.BLUE + colorama.Back.LIGHTGREEN_EX
81+
c3 = colorama.Fore.MAGENTA + colorama.Back.LIGHTYELLOW_EX
82+
cr = colorama.Style.RESET_ALL
7783
s_str = "SeleniumBase"
7884
s_str = s_str.replace("SeleniumBase", c1 + "Selenium" + c2 + "Base" + cr)
7985
s_str = s_str + cr + " " + c3 + "command-line options for pytest" + cr
@@ -807,7 +813,7 @@ def pytest_unconfigure():
807813
def sb(request):
808814
""" SeleniumBase as a pytest fixture.
809815
Usage example: "def test_one(sb):"
810-
You'll need to use this for tests that use other pytest fixtures. """
816+
You may need to use this for tests that use other pytest fixtures. """
811817
from seleniumbase import BaseCase
812818

813819
class BaseClass(BaseCase):

0 commit comments

Comments
 (0)