From 3acfa3abdc7577f97bb40b9790c10d43c0e486e4 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 17 Nov 2018 13:18:54 +0100 Subject: [PATCH] Add Testdir.__str__ to return str(self.tmpdir) I just expected this with `monkeypatch.setenv("PYTHONPATH", str(testdir))`, wondering why it was not picked up correctly. ` --- src/_pytest/pytester.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/_pytest/pytester.py b/src/_pytest/pytester.py index 24ddf4e9e..c59628948 100644 --- a/src/_pytest/pytester.py +++ b/src/_pytest/pytester.py @@ -518,6 +518,9 @@ class Testdir(object): def __repr__(self): return "" % (self.tmpdir,) + def __str__(self): + return str(self.tmpdir) + def finalize(self): """Clean up global state artifacts.