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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 3 additions & 5 deletions
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 3 additions & 3 deletions
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

0 commit comments

Comments
 (0)