Skip to content

Add Testdir.__str__ to return str(self.tmpdir)#4409

Merged
blueyed merged 1 commit into
pytest-dev:masterfrom
blueyed:str
Nov 18, 2018
Merged

Add Testdir.__str__ to return str(self.tmpdir)#4409
blueyed merged 1 commit into
pytest-dev:masterfrom
blueyed:str

Conversation

@blueyed

@blueyed blueyed commented Nov 17, 2018

Copy link
Copy Markdown
Contributor

I just expected this with monkeypatch.setenv("PYTHONPATH", str(testdir)),
wondering why it was not picked up correctly.

I just expected this with `monkeypatch.setenv("PYTHONPATH", str(testdir))`,
wondering why it was not picked up correctly.
`
@RonnyPfannschmidt

Copy link
Copy Markdown
Member

im on the fence on this one - i'd really like to treat this one as only a path if the fspath protocol is followed at best

@blueyed

blueyed commented Nov 17, 2018

Copy link
Copy Markdown
Contributor Author

It's not really treated as a path by this, but there is no point in str() returning its __repr__ I think, is there?

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as long as we actually call it testdir its probably ok to do

as a follow-up we might want to consider something with a more strict name and stricter boundaries

@blueyed blueyed merged commit cdbe229 into pytest-dev:master Nov 18, 2018
@blueyed blueyed deleted the str branch November 18, 2018 11:52
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.

2 participants