Skip to content

Commit dca7b05

Browse files
CarstenGrohmannphilpep
authored andcommitted
Typos corrected and small wording change
1 parent 120da73 commit dca7b05

26 files changed

+56
-57
lines changed

CHANGELOG.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ Changelog
389389
======
390390

391391
* package: fix is_installed and version behavior for uninstalled packages (#321 and #326)
392-
* ansible: Use predictibles test ordering when using pytest-xdist to fix random test collections errors (#316)
392+
* ansible: Use predictable test ordering when using pytest-xdist to fix random test collections errors (#316)
393393

394394
1.13.0
395395
======
@@ -436,7 +436,7 @@ Changelog
436436
1.9.0
437437
=====
438438

439-
* Interface: allow to find 'ip' command ousite of PATH
439+
* Interface: allow to find 'ip' command outside of PATH
440440
* Fix --nagios option with python 3
441441

442442
1.8.0
@@ -514,7 +514,7 @@ Changelog
514514
1.5.2
515515
=====
516516

517-
* Honnor become_user when using the ansible backend
517+
* Honor become_user when using the ansible backend
518518

519519
1.5.1
520520
=====

test/conftest.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,9 @@ def teardown():
108108
request.addfinalizer(teardown)
109109

110110
port = check_output("docker port %s 22", docker_id)
111-
# IPv4 addresses seem to be reported consistently
112-
# in the first line of the output.
113-
# To workaround https://github.com/moby/moby/issues/42442
114-
# use only the values of the first line of the command
115-
# output
111+
# IPv4 addresses seem to be reported consistently in the first line
112+
# of the output. To workaround https://github.com/moby/moby/issues/42442
113+
# use only the first line of the command output.
116114
port = int(port.splitlines()[0].rsplit(":", 1)[-1])
117115

118116
return docker_id, docker_host, port

test/test_backends.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ def test_ansible_get_host(kwargs, inventory, expected):
340340
"-o ControlPersist=60s host true"
341341
),
342342
),
343-
# identity_file has highest priority
343+
# identity_file has the highest priority
344344
(
345345
b"host ansible_user=user ansible_ssh_pass=password ansible_ssh_private_key_file=some_file",
346346
(
@@ -475,8 +475,8 @@ def test_ansible_unknown_option():
475475

476476

477477
def test_backend_importables():
478-
# just check that all declared backend are importable and NAME is set
479-
# correctly
478+
# check that all declared backends are importable and the backend name
479+
# is set correctly
480480
for connection_type in testinfra.backend.BACKENDS:
481481
obj = testinfra.backend.get_backend_class(connection_type)
482482
assert obj.get_connection_type() == connection_type

test/test_modules.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def test_rpmdb_corrupted(host):
7474

7575
@pytest.mark.testinfra_hosts("docker://rockylinux9")
7676
def test_non_default_package_tool(host):
77-
# Make non default pkg tool binary present
77+
# Make non-default pkg tool binary present
7878
host.run("install -m a+rx /bin/true /usr/bin/dpkg-query")
7979
assert host.package("openssh").is_installed
8080

@@ -150,7 +150,7 @@ def test_facter(host):
150150
assert host.facter()["os"]["distro"]["codename"] == "bookworm"
151151
assert host.facter("virtual") in (
152152
{"virtual": "docker"},
153-
{"virtual": "hyperv"}, # github action uses hyperv
153+
{"virtual": "hyperv"}, # GitHub action uses hyperv
154154
{"virtual": "physical"}, # I've this on my machine...
155155
)
156156

@@ -643,7 +643,7 @@ def test_addr(host):
643643
assert not non_resolvable.is_reachable
644644
assert not non_resolvable.port(80).is_reachable
645645

646-
# Some arbitrary internal IP, hopefully non reachable
646+
# Some arbitrary internal IP, hopefully non-reachable
647647
# IP addresses are always resolvable no matter what
648648
non_reachable_ip = host.addr("10.42.13.73")
649649
assert non_reachable_ip.is_resolvable

testinfra/backend/paramiko.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131

3232
class IgnorePolicy(paramiko.MissingHostKeyPolicy):
33-
"""Policy for ignoring missing host key."""
33+
"""Policy for ignoring a missing host key."""
3434

3535
def missing_host_key(
3636
self, client: paramiko.SSHClient, hostname: str, key: paramiko.pkey.PKey

testinfra/backend/ssh.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ def run_ssh(self, command: str) -> base.CommandResult:
9999
class SafeSshBackend(SshBackend):
100100
"""Run command using ssh command but try to get a more sane output
101101
102-
When using ssh (or a potentially bugged wrapper) additional output can be
103-
added in stdout/stderr and exit status may not be propagate correctly
102+
When using ssh (or a potentially bugged wrapper), additional output can be
103+
added in stdout/stderr and exit status may not be propagated correctly
104104
105105
To avoid that kind of bugs, we wrap the command to have an output like
106106
this:

testinfra/host.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def exists(self, command: str) -> bool:
5050
def find_command(
5151
self, command: str, extrapaths: Iterable[str] = ("/sbin", "/usr/sbin")
5252
) -> str:
53-
"""Return path of given command
53+
"""Return the path of the given command
5454
5555
raise ValueError if command cannot be found
5656
"""
@@ -147,7 +147,7 @@ def get_host(cls, hostspec: str, **kwargs: Any) -> "Host":
147147
`hostspec` should be like
148148
`<backend_type>://<name>?param1=value1&param2=value2`
149149
150-
Params can also be passed in `**kwargs` (eg. get_host("local://",
150+
Params can also be passed in `**kwargs` (e.g. get_host("local://",
151151
sudo=True) is equivalent to get_host("local://?sudo=true"))
152152
153153
Examples::

testinfra/modules/addr.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ class Addr(Module):
6363
>>> google.port(666).is_reachable
6464
False
6565
66-
Can also be use within a network namespace_.
66+
It can also be used within a network namespace_.
6767
6868
>>> localhost = host.addr("localhost", "ns1")
6969
>>> localhost.is_resolvable
7070
True
7171
7272
Network namespaces can only be used if ip_ command is available
73-
because in this case, the module use ip-netns_ as command prefix.
74-
In the other case, it will raise NotImplementedError.
73+
because in this case, the module uses ip-netns_ as command prefix.
74+
In the other case, it will raise a NotImplementedError.
7575
7676
.. _namespace: https://man7.org/linux/man-pages/man7/namespaces.7.html
7777
.. _ip: https://man7.org/linux/man-pages/man8/ip.8.html

testinfra/modules/ansible.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717

1818

1919
class AnsibleException(Exception):
20-
"""Exception raised when an error occur in an ansible call
20+
"""Exception raised when an error occurs in an ansible call.
2121
22-
result from ansible can be accessed through the ``result`` attribute
22+
Result from ansible can be accessed through the ``result`` attribute.
2323
2424
>>> try:
2525
... host.ansible("command", "echo foo")

testinfra/modules/blockdevice.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616

1717

1818
class BlockDevice(Module):
19-
"""Information for block device.
19+
"""Information for a block device.
2020
2121
Should be used with sudo or under root.
2222
23-
If device is not a block device, RuntimeError is raised.
23+
If the device is not a block device, RuntimeError is raised.
2424
"""
2525

2626
@property
@@ -90,7 +90,7 @@ def start_sector(self):
9090

9191
@property
9292
def is_writable(self):
93-
"""Return True if device is writable (have no RO status)
93+
"""Return True if the device is writable (have no RO status)
9494
9595
>>> host.block_device("/dev/sda").is_writable
9696
True

testinfra/modules/docker.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ def version(cls, format=None):
8383
def get_containers(cls, **filters):
8484
"""Return a list of containers
8585
86-
By default return list of all containers, including non-running
86+
By default, return a list of all containers, including non-running
8787
containers.
8888
8989
Filtering can be done using filters keys defined on
9090
https://docs.docker.com/engine/reference/commandline/ps/#filtering
9191
92-
Multiple filters for a given key is handled by giving a list of string
92+
Multiple filters for a given key are handled by giving a list of strings
9393
as value.
9494
9595
>>> host.docker.get_containers()

testinfra/modules/file.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def mode(self):
115115
>>> oct(host.file("/etc/shadow").mode) == '0o640'
116116
True
117117
118-
You can also utilize the file mode constants from
118+
You can also use the file mode constants from
119119
the stat_ library for testing file mode.
120120
121121
>>> import stat
@@ -128,7 +128,7 @@ def mode(self):
128128
raise NotImplementedError
129129

130130
def contains(self, pattern):
131-
"""Checks content of file for pattern
131+
"""Checks file content with a pattern
132132
133133
This uses grep and thus follows the grep regex syntax.
134134
"""
@@ -181,7 +181,7 @@ def mtime(self):
181181

182182
@property
183183
def size(self):
184-
"""Return size of file in bytes"""
184+
"""Return file size in bytes"""
185185
raise NotImplementedError
186186

187187
def listdir(self):

testinfra/modules/group.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def __init__(self, name):
2222

2323
@property
2424
def exists(self):
25-
"""Test if group exists
25+
"""Test if the group exists
2626
2727
>>> host.group("wheel").exists
2828
True

testinfra/modules/interface.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def default(cls, family=None):
181181

182182
@classmethod
183183
def names(cls):
184-
# -o is to tell the ip command to return 1 line per interface
184+
# -o is to tell the ip command to return one line per interface
185185
out = cls.check_output(f"{cls(None)._ip} -o link show")
186186
interfaces = []
187187
for line in out.splitlines():

testinfra/modules/iptables.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def rules(self, table="filter", chain=None, version=4):
5454
5555
Based on output of `iptables -t TABLE -S CHAIN` command
5656
57-
optionally takes takes the following arguments:
57+
optionally takes the following arguments:
5858
- table: defaults to `filter`
5959
- chain: defaults to all chains
6060
- version: default 4 (iptables), optionally 6 (ip6tables)

testinfra/modules/package.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def is_installed(self):
4343

4444
@property
4545
def release(self):
46-
"""Return the release specific info from the package version
46+
"""Return the release-specific info from the package version
4747
4848
>>> host.package("nginx").release
4949
'1.el6'

testinfra/modules/pip.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def get_packages(cls, pip_path="pip"):
103103

104104
@classmethod
105105
def get_outdated_packages(cls, pip_path="pip"):
106-
"""Get all outdated packages with current and latest version
106+
"""Get all outdated packages with the current and latest version
107107
108108
>>> host.pip.get_outdated_packages(
109109
... pip_path='~/venv/website/bin/pip')

testinfra/modules/podman.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ def name(self):
5252
def get_containers(cls, **filters):
5353
"""Return a list of containers
5454
55-
By default return list of all containers, including non-running
55+
By default, return a list of all containers, including non-running
5656
containers.
5757
5858
Filtering can be done using filters keys defined in
5959
podman-ps(1).
6060
61-
Multiple filters for a given key is handled by giving a list of string
62-
as value.
61+
Multiple filters for a given key are handled by giving a list of
62+
strings as value.
6363
6464
>>> host.podman.get_containers()
6565
[<podman nginx>, <podman redis>, <podman app>]

testinfra/modules/process.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ class PosixProcess(Process):
129129

130130
def _get_processes(self, **filters):
131131
cmd = "ps -Aww -o %s"
132-
# lstart and args attributes contains spaces. Put them at the end of the list
132+
# "lstart" and "args" attributes contains spaces. Put them at the
133+
# end of the list.
133134
attributes = sorted(
134135
({"pid", "comm", "pcpu", "pmem"} | set(filters)) - {"lstart", "args"}
135136
) + ["lstart", "args"]

testinfra/modules/service.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def __init__(self, name):
3535

3636
@property
3737
def exists(self):
38-
"""Test if service is exists"""
38+
"""Test if the service exists"""
3939
raise NotImplementedError
4040

4141
@property
@@ -53,7 +53,7 @@ def is_valid(self):
5353
"""Test if service is valid
5454
5555
This method is only available in the systemd implementation,
56-
it will raise ``NotImplementedError`` in others implementation
56+
it will raise ``NotImplementedError`` in other implementations.
5757
"""
5858
raise NotImplementedError
5959

@@ -62,7 +62,7 @@ def is_masked(self):
6262
"""Test if service is masked
6363
6464
This method is only available in the systemd implementation,
65-
it will raise ``NotImplementedError`` in others implementations
65+
it will raise ``NotImplementedError`` in other implementations.
6666
"""
6767
raise NotImplementedError
6868

@@ -78,7 +78,7 @@ def systemd_properties(self):
7878
'/lib/systemd/system/ntp.service'
7979
8080
This method is only available in the systemd implementation,
81-
it will raise ``NotImplementedError`` in others implementations
81+
it will raise ``NotImplementedError`` in other implementations.
8282
8383
Note: based on `systemctl show`_
8484

testinfra/modules/socket.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ def is_listening(self):
101101
>>> host.socket("tcp://80").is_listening
102102
False
103103
104-
.. note:: If you don't specify a host for udp and tcp sockets,
104+
.. Note:: If you don't specify a host for udp and tcp sockets,
105105
then the socket is listening if and only if the
106-
socket listen on **both** all ipv4 and ipv6 addresses
107-
(ie 0.0.0.0 and ::)
106+
socket listens on **both** all ipv4 and ipv6 addresses
107+
(i.e. 0.0.0.0 and ::)
108108
"""
109109
sockets = list(self._iter_sockets(True))
110110
if self.protocol == "unix":

testinfra/modules/sudo.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717

1818
class Sudo(InstanceModule):
19-
"""Sudo module allow to run certain portion of code under another user.
19+
"""Sudo module allows to run certain portion of code under another user.
2020
2121
It is used as a context manager and can be nested.
2222

testinfra/modules/supervisor.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ def _parse_status(line):
6666
splitted = line.split()
6767
name = splitted[0]
6868
status = splitted[1]
69-
# some old supervisorctl versions exit status is 0 even if it cannot
70-
# connect to supervisord socket and output the error to stdout. So we
69+
# Some old supervisorctl versions exit status is 0 even if it cannot
70+
# connect to supervisord socket and output the error to stdout. So we
7171
# check that parsed status is a known status.
7272
if status not in STATUS:
7373
supervisor_not_running()

0 commit comments

Comments
 (0)