Skip to content

Early import colorama so that it get's the correct terminal#2611

Merged
nicoddemus merged 4 commits into
pytest-dev:masterfrom
segevfiner:patch-1
Jul 24, 2017
Merged

Early import colorama so that it get's the correct terminal#2611
nicoddemus merged 4 commits into
pytest-dev:masterfrom
segevfiner:patch-1

Conversation

@segevfiner

@segevfiner segevfiner commented Jul 24, 2017

Copy link
Copy Markdown
Contributor

I have had it print ANSI escapes without stripping or conversion. With tartley/colorama#131 it captures the wrong default terminal attributes so that the default text color is black (colorama doesn't check for errors).

Importing colorama in a conftest.py should reproduce this.

  • Add a new news fragment into the changelog folder
    • name it $issue_id.$type for example (588.bug)
    • if you don't have an issue_id change it to the pr id after creating the pr
    • ensure type is one of removal, feature, bugfix, vendor, doc or trivial
    • Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."
  • Target: for bugfix, vendor, doc or trivial fixes, target master; for removals or features target features;
  • Make sure to include reasonable tests for your change if necessary

Unless your change is a trivial or a documentation fix (e.g., a typo or reword of a small section) please:

  • Add yourself to AUTHORS;

@nicoddemus

Copy link
Copy Markdown
Member

Awesome! This fixes #2510.

@nicoddemus

Copy link
Copy Markdown
Member

Just tested it and it fixes the problem wonderfully. Awesome job!

@nicoddemus

Copy link
Copy Markdown
Member

Updated the CHANGELOG message to point to #2510 and re-worded it for a more user-oriented description.

As soon as CI passes we can merge this. 😁

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.04%) to 92.057% when pulling d90bef4 on segevfiner:patch-1 into 0aa2480 on pytest-dev:master.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.04%) to 92.057% when pulling d90bef4 on segevfiner:patch-1 into 0aa2480 on pytest-dev:master.

Comment thread _pytest/capture.py Outdated
"""
Ensure colorama is imported so that it attaches to the correct stdio
handles on Windows.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The trailing whitespace here breaks the linting environment 😉

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you GitHub web editor 😝

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.04%) to 92.056% when pulling d0ecfdf on segevfiner:patch-1 into 0aa2480 on pytest-dev:master.

@nicoddemus nicoddemus merged commit e44284c into pytest-dev:master Jul 24, 2017
@nicoddemus

Copy link
Copy Markdown
Member

🎆

@The-Compiler

Copy link
Copy Markdown
Member

I just wanted to say thanks again for fixing this - I finally can use pytest with colors on Windows! 🎉

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.

5 participants