-
-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1676 from rmartin16/color-adb
ADB log tailing color output
- Loading branch information
Showing
8 changed files
with
124 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
When an app runs on an Android device or emulator, the logging output is now colored. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from unittest.mock import PropertyMock | ||
|
||
import pytest | ||
from rich.console import ColorSystem | ||
|
||
from briefcase.console import Console, Printer | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"no_color, color_system, is_enabled", | ||
[ | ||
(False, ColorSystem.TRUECOLOR, True), | ||
(False, None, False), | ||
(True, ColorSystem.TRUECOLOR, False), | ||
(True, None, False), | ||
], | ||
) | ||
def test_is_color_enabled(no_color, color_system, is_enabled, monkeypatch): | ||
"""Color is enabled/disabled based on no_color and color_system.""" | ||
printer = Printer() | ||
monkeypatch.setattr( | ||
type(printer.console), | ||
"color_system", | ||
PropertyMock(return_value=color_system), | ||
) | ||
printer.console.no_color = no_color | ||
console = Console(printer=printer) | ||
|
||
# confirm these values to make sure they didn't change somehow... | ||
assert printer.console.no_color is no_color | ||
assert printer.console.color_system is color_system | ||
|
||
assert console.is_color_enabled is is_enabled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters