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

terminal: fix crash in header reporting when absolute testpaths is used #7817

Merged
merged 3 commits into from Oct 3, 2020

Commits on Sep 29, 2020

  1. Configuration menu
    Copy the full SHA
    db08c7f View commit details
    Browse the repository at this point in the history
  2. terminal: fix crash in header reporting when absolute testpaths is used

    Regressed in 6.1.0 in 62e249a.
    The `x` is an `str` but is expected to be a `pathlib.Path`. Not caught
    by mypy because `config.getini()` returns `Any`.
    
    Fix by just removing the `bestrelpath` call:
    
    - testpaths are always relative to the rootdir, it thus would be very
      unusual to specify an absolute path there.
    
    - The code was wrong even before the regression: `py.path.local`'s
      `bestrelpath` function expects a `py.path.local`, not an `str`. But it
      had some weird `try ... except AttributeError` fallback which just
      returns the argument, i.e. it was a no-op. So there is no behavior
      change.
    
    - It seems reasonable to me to just print the full path if that's what
      the ini specifies.
    bluetech committed Sep 29, 2020
    Configuration menu
    Copy the full SHA
    61f80a7 View commit details
    Browse the repository at this point in the history
  3. terminal: improve condition on whether to display testpaths in header

    Make it match better the condition on whether testpaths is used (found
    in config/__init__.py).
    bluetech committed Sep 29, 2020
    Configuration menu
    Copy the full SHA
    3ecdad6 View commit details
    Browse the repository at this point in the history