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鈥檒l 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

Comments

Projects
None yet
4 participants
@hackebrot
Member

hackebrot commented Jul 15, 2017

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

@nicoddemus

This comment has been minimized.

Member

nicoddemus commented Jul 15, 2017

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

@hackebrot

This comment has been minimized.

Member

hackebrot commented Jul 15, 2017

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

This comment has been minimized.

Member

hackebrot commented Jul 15, 2017

I'm writing a test for it. 馃憤

@hackebrot

This comment has been minimized.

Member

hackebrot commented Jul 15, 2017

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

This comment has been minimized.

Member

RonnyPfannschmidt commented Jul 16, 2017

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

@asottile

This comment has been minimized.

Member

asottile commented Aug 3, 2017

Here's a screenshot from my dupe bug report:

@asottile

This comment has been minimized.

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

This comment has been minimized.

Member

RonnyPfannschmidt commented Aug 3, 2017

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

@RonnyPfannschmidt

This comment has been minimized.

Member

RonnyPfannschmidt commented Aug 3, 2017

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

This comment has been minimized.

Member

hackebrot commented Aug 4, 2017

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