diff options
author | Daniel Watkins <oddbloke@ubuntu.com> | 2020-06-22 11:11:03 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-22 11:11:03 -0400 |
commit | 055731eade79d4121d1005469765207e425ac343 (patch) | |
tree | 2c3f780493a70d036219abd3ff9553883064d14f /HACKING.rst | |
parent | 0755cff078d5931e1d8e151bdcb84afb92bc0f02 (diff) | |
download | vyos-cloud-init-055731eade79d4121d1005469765207e425ac343.tar.gz vyos-cloud-init-055731eade79d4121d1005469765207e425ac343.zip |
HACKING.rst: add strpath gotcha to testing gotchas section (#446)
Co-authored-by: Rick Harding <rharding@mitechie.com>
Diffstat (limited to 'HACKING.rst')
-rw-r--r-- | HACKING.rst | 8 |
1 files changed, 8 insertions, 0 deletions
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 |