Skip to content

"<-" in verbose test output #3211

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

Closed
twmr opened this issue Feb 12, 2018 · 9 comments
Closed

"<-" in verbose test output #3211

twmr opened this issue Feb 12, 2018 · 9 comments
Labels
topic: reporting related to terminal output and user-facing messages and errors type: enhancement new feature or API change, should be merged into features branch

Comments

@twmr
Copy link
Contributor

twmr commented Feb 12, 2018

In my integrationtests the verbose text output does not seem to be consistent. There are three different types of lines in the output of pytest:

relpath::TestClass::testmethod1 PASSED
relpath::TestClass::testmethod2 <- ../../path/to/testbase.py SKIPPED
relpath::TestClass::testmethod3 <- abspath PASSED

I don't understand why the last two lines contain '<-' and a subsequent path. I've studied the code in https://github.com/pytest-dev/pytest/blob/master/src/_pytest/terminal.py#L517 but I don't understand it. Can anyone help me?

The "<-" in the pytest output was introduced in d73e689

@twmr
Copy link
Contributor Author

twmr commented Feb 13, 2018

I've found a few tests in test_terminal.py which indicate that the lines containing "<-" have sth to do with baseclasses in different test modules. I think this behavior should be configurable and preferably opt-in.

@nicoddemus
Copy link
Member

IIRC your assessment is correct, here's a minimal reproducer:

# contents of base.py
class D:
    def test_foobar(self):
        pass

# contents of test_foo.py
from base import D

class Test(D):

    def test_foo(self):
        pass
$ python -m pytest .
============================= test session starts =============================
platform win32 -- Python 3.6.3, pytest-3.4.2.dev61+g54e63b7.d20180222, py-1.5.2, pluggy-0.6.1.dev -- C:\pytest\.env36\Scripts\python.exe
cachedir: ..\.pytest_cache
rootdir: C:\pytest\.tmp, inifile: pytest.ini
plugins: forked-0.2, hypothesis-3.38.9
collected 2 items

test_foo.py::Test::test_foobar <- base\base.py PASSED                    [ 50%]
test_foo.py::Test::test_foo PASSED                                       [100%]

========================== 2 passed in 0.02 seconds ===========================

I wouldn't mind adding an option and also changing to not use the <- indicator by default: I think it in general just confuses people.

@nicoddemus nicoddemus added type: proposal proposal for a new feature, often to gather opinions or design the API around the new feature topic: reporting related to terminal output and user-facing messages and errors labels Feb 26, 2018
@fontealpina
Copy link

@nicoddemus I agree

@nicoddemus nicoddemus added type: enhancement new feature or API change, should be merged into features branch and removed type: proposal proposal for a new feature, often to gather opinions or design the API around the new feature labels Mar 6, 2018
@pfctdayelise
Copy link
Contributor

What would be better to use instead of <- ?

How about just removing the reporting of base classes completely?

@twmr
Copy link
Contributor Author

twmr commented Sep 11, 2018

I'm totally in for removing the reporting of the base classes.

@RonnyPfannschmidt
Copy link
Member

can we take a look at how and when it was introduced beforehand

@twmr
Copy link
Contributor Author

twmr commented Sep 11, 2018

Edit: added the link to the commit, where this output format was introduced to the description of this issue.

@RonnyPfannschmidt
Copy link
Member

thanks for the research, i do wonder if we should move it to a higher verbosity level instead of removing it since its quite useful for debugging various legacy codebases

@twmr
Copy link
Contributor Author

twmr commented Oct 15, 2018

@RonnyPfannschmidt thx for the suggestion, I'll simply change the verbosity level.

twmr added a commit to twmr/pytest that referenced this issue Oct 15, 2018
To show the subclassed file in legacy test suits in the runtest output
you have to set the verbosity level to at least "-vv" now.

Closes pytest-dev#3211
twmr added a commit to twmr/pytest that referenced this issue Oct 15, 2018
To show the subclassed file in legacy test suits in the runtest output
you have to set the verbosity level to at least "-vv" now.

Closes pytest-dev#3211
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: reporting related to terminal output and user-facing messages and errors type: enhancement new feature or API change, should be merged into features branch
Projects
None yet
Development

No branches or pull requests

5 participants