summaryrefslogtreecommitdiff
path: root/doc/en/example
diff options
context:
space:
mode:
authorRan Benita <ran@unusedvar.com>2020-07-18 12:35:13 +0300
committerRan Benita <ran@unusedvar.com>2020-08-03 10:10:43 +0300
commitb8471aa527ab1a21ee66f24e5c23a9773b5b0793 (patch)
tree37dfeeea501768be711d7faefae6a1c3fcec29d1 /doc/en/example
parent701998bf2c9e91e8b153ef237c96c31294b8b8c7 (diff)
downloadpytest-b8471aa527ab1a21ee66f24e5c23a9773b5b0793.tar.gz
testing: fix some docstring issues
In preparation for enforcing some docstring lints.
Diffstat (limited to 'doc/en/example')
-rw-r--r--doc/en/example/nonpython/conftest.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/doc/en/example/nonpython/conftest.py b/doc/en/example/nonpython/conftest.py
index d30ab3841..6e5a57092 100644
--- a/doc/en/example/nonpython/conftest.py
+++ b/doc/en/example/nonpython/conftest.py
@@ -9,7 +9,8 @@ def pytest_collect_file(parent, path):
class YamlFile(pytest.File):
def collect(self):
- import yaml # we need a yaml parser, e.g. PyYAML
+ # We need a yaml parser, e.g. PyYAML.
+ import yaml
raw = yaml.safe_load(self.fspath.open())
for name, spec in sorted(raw.items()):
@@ -23,12 +24,12 @@ class YamlItem(pytest.Item):
def runtest(self):
for name, value in sorted(self.spec.items()):
- # some custom test execution (dumb example follows)
+ # Some custom test execution (dumb example follows).
if name != value:
raise YamlException(self, name, value)
def repr_failure(self, excinfo):
- """ called when self.runtest() raises an exception. """
+ """Called when self.runtest() raises an exception."""
if isinstance(excinfo.value, YamlException):
return "\n".join(
[
@@ -43,4 +44,4 @@ class YamlItem(pytest.Item):
class YamlException(Exception):
- """ custom exception for error reporting. """
+ """Custom exception for error reporting."""