From 055731eade79d4121d1005469765207e425ac343 Mon Sep 17 00:00:00 2001 From: Daniel Watkins Date: Mon, 22 Jun 2020 11:11:03 -0400 Subject: HACKING.rst: add strpath gotcha to testing gotchas section (#446) Co-authored-by: Rick Harding --- HACKING.rst | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'HACKING.rst') diff --git a/HACKING.rst b/HACKING.rst index 81e6c266..47ac6a86 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -227,6 +227,14 @@ The following guidelines should be followed: * ``tmpdir_factory`` * ``tmpdir`` + * On xenial, the objects returned by the ``tmpdir`` fixture cannot be + used where paths are required; they are rejected as invalid paths. + You must instead use their ``.strpath`` attribute. + + * For example, instead of + ``util.write_file(tmpdir.join("some_file"), ...)``, you should + write ``util.write_file(tmpdir.join("some_file").strpath, ...)``. + * Variables/parameter names for ``Mock`` or ``MagicMock`` instances should start with ``m_`` to clearly distinguish them from non-mock variables -- cgit v1.2.3