Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP/TEST] terminalwriter: use colorama also for non-tty (Travis) #224

Closed
wants to merge 2 commits into from

Conversation

blueyed
Copy link
Contributor

@blueyed blueyed commented Aug 13, 2019

No description provided.

@blueyed
Copy link
Contributor Author

blueyed commented Aug 13, 2019

This is meant to have colors on CI / Travis (Windows) also.

Currently fails tests on AppVeyor/Windows, e.g.:

____________________ test_should_do_markup_PY_COLORS_eq_1 _____________________
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x00000000046C4E80>
    def test_should_do_markup_PY_COLORS_eq_1(monkeypatch):
        monkeypatch.setitem(os.environ, 'PY_COLORS', '1')
        tw = py.io.TerminalWriter(stringio=True)
        assert tw.hasmarkup
        tw.line("hello", bold=True)
        s = tw.stringio.getvalue()
>       assert len(s) > len("hello\n")
E       AssertionError: assert 6 > 6
E        +  where 6 = len('hello\n')
E        +  and   6 = len('hello\n')
testing\io_\test_terminalwriter.py:293: AssertionError

Likely it is using real Windows colors there already?

I do not really plan to work on this, feel free to adopt or close.

@blueyed
Copy link
Contributor Author

blueyed commented Aug 16, 2019

Does not use colors on Travis/Windows still: https://travis-ci.com/pdbpp/pdbpp/jobs/225971063#L125.

Using --color=yes with pytest works, but only when using colorama (the default, but I am uninstalling it for tests in one env).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant