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

Test report text issue #2579

Closed
hackebrot opened this issue Jul 15, 2017 · 10 comments
Closed

Test report text issue #2579

hackebrot opened this issue Jul 15, 2017 · 10 comments
Labels
type: bug problem that needs to be addressed

Comments

@hackebrot
Copy link
Member

Hi! 👋

I'm working off the features branch right now and noticed that the test output reads:

collected 1 item s

tests/test_helloworld.py .

Looks like we have tiny issue with item s 😁

/cc @flub

@hackebrot hackebrot added type: bug problem that needs to be addressed EP2017 sprint labels Jul 15, 2017
@nicoddemus
Copy link
Member

Should have been fixed by #2571... are you still seeing this even after it?

@hackebrot
Copy link
Member Author

I just cherry-picked the commit from the bugfix PR. Looks like it's still showing the extra space, but only if a single test is collected

def test_helloworld():
    assert "Hello"
$ pytest test_unwanted_space.py

collected 1 item s

test_unwanted_space.py .

@hackebrot
Copy link
Member Author

I'm writing a test for it. 👍

@hackebrot
Copy link
Member Author

Can't get my unittest for the bug to fail. Most probably because pytester works differently than if you run pytest from the CLI 😢

@RonnyPfannschmidt
Copy link
Member

i suspect it will be hard to test unless we run pytest against a pty and a terminal emulator

@asottile
Copy link
Member

asottile commented Aug 3, 2017

Here's a screenshot from my dupe bug report:

@asottile
Copy link
Member

asottile commented Aug 3, 2017

From some testing, the "rewrite" needs to overwrite the entire previous line:

$ echo -e 'hello\rhi'
hillo
$ echo -e 'hello     \rhi'
hillo     
$ echo -e 'hello\r     \rhi'
hi   
$ echo -e 'hello     \rhi'
hillo     
$ echo -e 'hello\r     \rhi'
hi   
$ echo -e 'hello\r\rhi'
hillo

this SO post implies there's a better solution but I'm unsure how portable it is...

@RonnyPfannschmidt
Copy link
Member

vt100 has escape codes to do stuff like clearing lines, i believe colorama ports those to windows

@RonnyPfannschmidt
Copy link
Member

but this has to be fixed in pylib

i should note that terminalwriter is fairly aged, i wish we could remove it, but people depend on it too much :/

@hackebrot
Copy link
Member Author

Thank you for looking into this @nicoddemus @RonnyPfannschmidt! 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug problem that needs to be addressed
Projects
None yet
Development

No branches or pull requests

4 participants