Skip to content

Wrong relative path in skip report when tested file is upper than invocation directory #7076

@CarycaKatarzyna

Description

@CarycaKatarzyna

The problem is if tested file is upper than invocation directory . It occurs in skip report.
Example:
path of tested file is:/home/xyz/my_tests/test1.py
and pytest is called in location: /home/xyz/pytest.

 xyz@ubuntu:~/pytest$ pytest -rs ../my_tests/test1.py
============================================== test session starts ===============================================
platform linux -- Python 3.7.5, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
rootdir: /home/xyz
plugins: hypothesis-5.6.0
collected 1 item                                                                                                 

../my_tests/test1.py s                                                                                     [100%]

============================================ short test summary info =============================================
SKIPPED [1] my_tests/test1.py:3: no way of currently testing this
=============================================== 1 skipped in 0.01s ===============================================

Instead SKIPPED [1] my_tests/test1.py:3: no way of currently testing this it should be
SKIPPED [1] ../my_tests/test1.py:3: no way of currently testing this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions