Skip to content

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

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

Merged
merged 4 commits into from
Jul 24, 2017

Conversation

segevfiner
Copy link
Contributor

@segevfiner segevfiner commented Jul 24, 2017

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
Member

Awesome! This fixes #2510.

@nicoddemus
Copy link
Member

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

@nicoddemus
Copy link
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

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

Coverage Status

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

"""
Ensure colorama is imported so that it attaches to the correct stdio
handles on Windows.

Copy link
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
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

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
Member

🎆

@The-Compiler
Copy link
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