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 testpaths is used without cli arguments #7816

Closed

Conversation

bluetech
Copy link
Member

Fixes #7814.

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.

The code was actually wrong before, even 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.

…t cli arguments

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`.

The code was actually wrong before, even `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.
@bluetech bluetech added the needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch label Sep 29, 2020
@bluetech
Copy link
Member Author

Hmm it doesn't work well on Windows, will take a look later.

@bluetech
Copy link
Member Author

Looking at this a bit more, I'll go with a different approach.

@bluetech bluetech closed this Sep 29, 2020
@bluetech bluetech removed the needs backport applied to PRs, indicates that it should be ported to the current bug-fix branch label Oct 3, 2020
@bluetech bluetech deleted the fix-testpaths-bestrelpath branch January 21, 2022 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] testpaths broken, captured as string
1 participant