diff options
author | Daniel Watkins <oddbloke@ubuntu.com> | 2020-03-26 15:47:45 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-26 15:47:45 -0400 |
commit | 4c88d9341e75a1a14ba2e8bd0ab309e265229f7e (patch) | |
tree | c2deb33c68ee0731071cd310fce1010fba38cfdc | |
parent | 1fefeef92fd1881b21e124b83f2adefd3e014087 (diff) | |
download | vyos-cloud-init-4c88d9341e75a1a14ba2e8bd0ab309e265229f7e.tar.gz vyos-cloud-init-4c88d9341e75a1a14ba2e8bd0ab309e265229f7e.zip |
HACKING.rst: add examples of the two test class types (#278)
-rw-r--r-- | HACKING.rst | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/HACKING.rst b/HACKING.rst index 763f83aa..bf57652d 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -164,8 +164,11 @@ The following guidelines should be following: test file * These can be easily distinguished by their definition: pytest - classes will not use inheritance at all, whereas ``TestCase`` - classes will subclass (indirectly) from ``TestCase`` + classes will not use inheritance at all (e.g. + `TestGetPackageMirrorInfo`_), whereas ``TestCase`` classes will + subclass (indirectly) from ``TestCase`` (e.g. + `TestPrependBaseCommands`_) + * pytest tests should use bare ``assert`` statements, to take advantage of pytest's `assertion introspection`_ @@ -176,4 +179,6 @@ The following guidelines should be following: .. _pytest: https://docs.pytest.org/ .. _pytest fixtures: https://docs.pytest.org/en/latest/fixture.html +.. _TestGetPackageMirrorInfo: https://github.com/canonical/cloud-init/blob/42f69f410ab8850c02b1f53dd67c132aa8ef64f5/cloudinit/distros/tests/test_init.py\#L15 +.. _TestPrependBaseCommands: https://github.com/canonical/cloud-init/blob/master/cloudinit/tests/test_subp.py#L9 .. _assertion introspection: https://docs.pytest.org/en/latest/assert.html |