[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [sbws/master] fix: semi-automatic correction of typos
commit 888fb6e88366e4bdaced0239d833ecee11fac636
Author: juga0 <juga@xxxxxxxxxx>
Date: Wed Mar 17 12:51:35 2021 +0000
fix: semi-automatic correction of typos
Closes #33599.
---
docs/source/contributing.rst | 10 +++++-----
docs/source/examples/sbws.example.ini | 2 +-
docs/source/generator.rst | 6 +++---
docs/source/glossary.rst | 4 ++--
docs/source/how_works.rst | 2 +-
docs/source/implementation.rst | 10 +++++-----
docs/source/man_sbws.rst | 2 +-
docs/source/roadmap.rst | 2 +-
docs/source/testing.rst | 2 +-
sbws/core/generate.py | 2 +-
sbws/core/scanner.py | 8 ++++----
sbws/core/stats.py | 2 +-
sbws/globals.py | 4 ++--
sbws/lib/circuitbuilder.py | 2 +-
sbws/lib/destination.py | 8 ++++----
sbws/lib/relaylist.py | 2 +-
sbws/lib/relayprioritizer.py | 4 ++--
sbws/lib/resultdump.py | 13 +++++++------
sbws/lib/v3bwfile.py | 8 ++++----
sbws/util/fs.py | 6 +++---
sbws/util/stem.py | 4 ++--
tests/integration/chutney_data/client_bwscanner.tmpl | 2 +-
tests/integration/run.sh | 2 +-
tests/unit/core/test_generate.py | 4 ++--
tests/unit/lib/test_destination.py | 2 +-
tests/unit/lib/test_relaylist.py | 2 +-
tests/unit/lib/test_resultdump.py | 2 +-
tests/unit/lib/test_v3bwfile.py | 2 +-
tests/unit/util/test_state.py | 2 +-
29 files changed, 61 insertions(+), 60 deletions(-)
diff --git a/docs/source/contributing.rst b/docs/source/contributing.rst
index c17aa4a..551ba7d 100644
--- a/docs/source/contributing.rst
+++ b/docs/source/contributing.rst
@@ -111,11 +111,11 @@ New features should add a corresponding documentation in /docs.
An editor compatible with `EditorConfig <https://editorconfig.org/>`_ will
help you to follow the general formatting code style.
-Timestamps must be in UTC. It is prefered to use ``datetime`` objects or
+Timestamps must be in UTC. It is preferred to use ``datetime`` objects or
Unix timestamps. Timestamps read by the user should be always formatted in
`ISO 8601 <https://en.wikipedia.org/wiki/ISO_8601>`_
-Functional style is prefered:
+Functional style is preferred:
- use list comprenhensions lambda, map, reduce
- avoid reasigigning variables, instead create new ones
@@ -148,7 +148,7 @@ and possibly the bugfix version.
The commit message should contain ``Closes: #bugnumber``.
From version 1.0.2 we started to prefix the summary with the subpackage or
-component, though we have not standarized the words to use, eg: ``scanner``,
+component, though we have not standardized the words to use, eg: ``scanner``,
``generate``, ``v3bwfile``, ``relaylist``, ``doc``, ``test``, ``CI``.
From version 1.0.3, we also started to prefix the summary with ``new``,
@@ -156,7 +156,7 @@ From version 1.0.3, we also started to prefix the summary with ``new``,
sections in the CHANGELOG.
From version 1.1.0 we started to use the words ``new``, ``chg`` and ``fix``,
-not in the sense `gitchangelog`_ use them, but to match sematic versioning
+not in the sense `gitchangelog`_ use them, but to match semantic versioning
changes major, minor and patch.
Try to make each commit a logically separate changes.::
@@ -313,7 +313,7 @@ Example commit message
between, but conventions vary here
-.. rubric:: External eferences
+.. rubric:: External references
.. [DIST] https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project
.. [MERG] https://www.atlassian.com/git/tutorials/merging-vs-rebasing
diff --git a/docs/source/examples/sbws.example.ini b/docs/source/examples/sbws.example.ini
index 1a2d6a4..657da48 100644
--- a/docs/source/examples/sbws.example.ini
+++ b/docs/source/examples/sbws.example.ini
@@ -30,7 +30,7 @@ country = ZZ
max_num_failures = 3
## The following logging options are set by default.
-## There is no need to change them unless other options are prefered.
+## There is no need to change them unless other options are preferred.
; [logging]
; # Whether or not to log to a rotating file the directory paths.log_dname
; to_file = yes
diff --git a/docs/source/generator.rst b/docs/source/generator.rst
index 7d43d33..986be0c 100644
--- a/docs/source/generator.rst
+++ b/docs/source/generator.rst
@@ -23,15 +23,15 @@ Each relay bandwidth measurements are selected in the following way:
#. At least two bandwidth measurements (``Result`` s) MUST have been obtained
within an arbitrary number of seconds (currently one day).
- If they are not, the relay MUST NOT be included in the Bandwith File.
-#. The measurements than are are older than an arbitrary number of senconds
+ If they are not, the relay MUST NOT be included in the Bandwidth File.
+#. The measurements than are are older than an arbitrary number of seconds
in the past MUST be discarded.
Currently this number is the same as ``data_period`` (5 days) when not
scaling as Torflow and 28 days when scaling as Torflow.
If the number of relays to include in the Bandwidth File are less than
a percententage (currently 60%) than the number of relays in the consensus,
-additional Header Lines MUST be added (see XXX) to the Bandwith File and the
+additional Header Lines MUST be added (see XXX) to the Bandwidth File and the
relays SHOULD NOT be included.
.. image:: ./images/activity_aggr_file.svg
diff --git a/docs/source/glossary.rst b/docs/source/glossary.rst
index 7d175b6..b7b0a03 100644
--- a/docs/source/glossary.rst
+++ b/docs/source/glossary.rst
@@ -20,7 +20,7 @@ Glossary
generator
Term to refer to the tool that generates the
- :term:`bandwidth list file` s. Often used as a synomym for
+ :term:`bandwidth list file` s. Often used as a synonym for
:term:`scanner`.
bandwidth list file
@@ -44,6 +44,6 @@ Glossary
destination
The term used by ``sbws`` to refer to a Web server where the
- :term:`scanner` request files to perform the bandwith measurements.
+ :term:`scanner` request files to perform the bandwidth measurements.
.. [#] https://metrics.torproject.org/glossary.html
diff --git a/docs/source/how_works.rst b/docs/source/how_works.rst
index ebe4cf9..d45e4ca 100644
--- a/docs/source/how_works.rst
+++ b/docs/source/how_works.rst
@@ -26,7 +26,7 @@ by a :term:`directory authority` to report relaysâ?? bandwidth in its vote.
.. image:: ./images/dirauths_bwauths.png
-Intialization
+Initialization
--------------
.. At some point it should be able to get environment variables
diff --git a/docs/source/implementation.rst b/docs/source/implementation.rst
index ad48a51..68f72b5 100644
--- a/docs/source/implementation.rst
+++ b/docs/source/implementation.rst
@@ -10,7 +10,7 @@ re-implement the feature:
Possible advantages using other software:
-- zero maintainance
+- zero maintenance
- not reinventing the wheel
Possible disadvantages using other software:
@@ -36,10 +36,10 @@ A first solution would be to obtain the git revision at runtime, but:
the git revision of that other repository.
So next solution was to obtain the git revision at build/install time.
-To achive this, an script should be called from the installer or at runtime
+To achieve this, an script should be called from the installer or at runtime
whenever `__version__` needs to be read.
-While it could be implemented by us, there're two external tools that achive
+While it could be implemented by us, there're two external tools that achieve
this.
setuptools_scm
@@ -102,7 +102,7 @@ Changing Bandwidth file monitoring KeyValues
--------------------------------------------
In version 1.1.0 we added KeyValues call ``recent_X_count`` and
-``relay_X_count`` which implied to modify serveral parts of the code.
+``relay_X_count`` which implied to modify several parts of the code.
We only stored numbers for simpliciy, but then the value of this numbers
accumulate over the time and there is no way to know to which number decrease
@@ -159,7 +159,7 @@ will be correct after 5 days and they have been wrong for long time.
Additionally ``recent_measurement_failure_count`` will be negative, since it's
calculated as ``recent_measurement_attempt_count`` minus all the results.
-While the total number of results in the last 5 days is corrrect, the number of
+While the total number of results in the last 5 days is correct, the number of
the attempts won't be until 5 days have pass.
Disadvantages
diff --git a/docs/source/man_sbws.rst b/docs/source/man_sbws.rst
index 608c36d..3586cef 100644
--- a/docs/source/man_sbws.rst
+++ b/docs/source/man_sbws.rst
@@ -75,7 +75,7 @@ In the following list, the first path is the default location when running
**sbws** as a system service.
**$HOME/.sbws.ini** or **/etc/sbws/sbws.ini**
- Location where **sbws** searchs for a custom configuration file, when the
+ Location where **sbws** searches for a custom configuration file, when the
option **--config** is not provided.
**$HOME/.sbws** or **/var/lib/sbws**
diff --git a/docs/source/roadmap.rst b/docs/source/roadmap.rst
index 4fc4b01..ba27b24 100644
--- a/docs/source/roadmap.rst
+++ b/docs/source/roadmap.rst
@@ -6,7 +6,7 @@ Roadmap
Release 1.0.0
--------------
-Autum 2018
+Autumn 2018
- Minimal Viable Product (MVP)
Release 1.1.0
diff --git a/docs/source/testing.rst b/docs/source/testing.rst
index ac15027..ebe2ae5 100644
--- a/docs/source/testing.rst
+++ b/docs/source/testing.rst
@@ -3,7 +3,7 @@
Installing tests dependencies and running tests
==================================================
-To run the tests, extra Python depenencies are needed:
+To run the tests, extra Python dependencies are needed:
- Flake8_
- tox_
diff --git a/sbws/core/generate.py b/sbws/core/generate.py
index ecc0b53..add7a79 100644
--- a/sbws/core/generate.py
+++ b/sbws/core/generate.py
@@ -121,7 +121,7 @@ def gen_parser(sub):
"--min-num",
default=NUM_MIN_RESULTS,
type=int,
- help="Mininum number of a results to consider them.",
+ help="Minimum number of a results to consider them.",
)
return p
diff --git a/sbws/core/scanner.py b/sbws/core/scanner.py
index 38ddef2..dbcceb9 100644
--- a/sbws/core/scanner.py
+++ b/sbws/core/scanner.py
@@ -355,7 +355,7 @@ def measure_relay(args, conf, destinations, cb, rl, relay):
return [
ResultError(relay, [], "", our_nick, msg=reason),
]
- # Pick a destionation
+ # Pick a destination
dest = destinations.next()
# When there're no any functional destinations.
if not dest:
@@ -686,7 +686,7 @@ def main_loop(
the ``Result`` from the queue and write it to disk, so this doesn't block
the measurement threads.
- If there was an exception not catched by ``measure_relay``, it will call
+ If there was an exception not caught by ``measure_relay``, it will call
instead ``result_putter_error``, which logs the error and complete
immediately.
@@ -774,7 +774,7 @@ def wait_for_results(num_relays_to_measure, pending_results):
While there are relays being measured, just log the progress
and sleep :const:`~sbws.globals.TIMEOUT_MEASUREMENTS` (3mins),
- which is aproximately the time it can take to measure a relay in
+ which is approximately the time it can take to measure a relay in
the worst case.
When there has not been any relay measured in ``TIMEOUT_MEASUREMENTS``
@@ -914,7 +914,7 @@ def run_speedtest(args, conf):
except KeyboardInterrupt:
log.info("Interrupted by the user.")
stop_threads(signal.SIGINT, None)
- # Any exception not catched at this point would make the scanner stall.
+ # Any exception not caught at this point would make the scanner stall.
# Log it and exit gracefully.
except Exception as e:
log.critical(FILLUP_TICKET_MSG)
diff --git a/sbws/core/stats.py b/sbws/core/stats.py
index bd8c88b..0aebcfc 100644
--- a/sbws/core/stats.py
+++ b/sbws/core/stats.py
@@ -51,7 +51,7 @@ def _result_type_per_relay(data, result_type):
def _get_box_plot_values(iterable):
- """Reutrn the min, q1, med, q1, and max of the input list or iterable.
+ """Return the min, q1, med, q1, and max of the input list or iterable.
This function is NOT perfect, and I think that's fine for basic statistical
needs. Instead of median, it will return low or high median. Same for q1
and q3."""
diff --git a/sbws/globals.py b/sbws/globals.py
index 4658868..16d8aa5 100644
--- a/sbws/globals.py
+++ b/sbws/globals.py
@@ -33,7 +33,7 @@ TORRC_STARTING_POINT = {
"SafeLogging": "0",
"LogTimeGranularity": "1",
"ProtocolWarnings": "1",
- # To be able to responde to MaxAdvertisedBandwidth as soon as possible.
+ # To be able to respond to MaxAdvertisedBandwidth as soon as possible.
# If ``FetchDirInfoExtraEarly` is set, but not
# `FetchDirInfoEarly`, Tor will throw this error:
# `FetchDirInfoExtraEarly requires that you also set FetchDirInfoEarly`
@@ -52,7 +52,7 @@ TORRC_RUNTIME_OPTIONS = {
# so do not let Tor to build them.
"__DisablePredictedCircuits": "1",
# The scanner attach the streams to the circuit itself,
- # so do not let Tor to attache them.
+ # so do not let Tor to attach them.
"__LeaveStreamsUnattached": "1",
}
# Options that can be set at runtime and can fail with some Tor versions
diff --git a/sbws/lib/circuitbuilder.py b/sbws/lib/circuitbuilder.py
index 8b9c520..e2b84f2 100644
--- a/sbws/lib/circuitbuilder.py
+++ b/sbws/lib/circuitbuilder.py
@@ -96,7 +96,7 @@ class CircuitBuilder:
# In a future refactor, remove this class, since sbws chooses the relays to
-# build the circuit, the relays are not just choosen as random as this class
+# build the circuit, the relays are not just chosen as random as this class
# does.
class GapsCircuitBuilder(CircuitBuilder):
"""Same as ``CircuitBuilder`` but implements build_circuit."""
diff --git a/sbws/lib/destination.py b/sbws/lib/destination.py
index ae1e695..5d1e390 100644
--- a/sbws/lib/destination.py
+++ b/sbws/lib/destination.py
@@ -164,7 +164,7 @@ class Destination:
num_attempts_stored=NUM_DESTINATION_ATTEMPTS_STORED,
factor_increment_retry=FACTOR_INCREMENT_DESTINATION_RETRY,
):
- """Initalizes the Web server from which the data is downloaded.
+ """Initializes the Web server from which the data is downloaded.
:param str url: Web server data URL to download.
:param int max_dl: Maximum size of the the data to download.
@@ -192,8 +192,8 @@ class Destination:
self._max_seconds_between_retries = max_seconds_between_retries
# Using a deque (FIFO) to do not grow forever and
# to do not have to remove old attempts.
- # Store tuples of timestamp and whether the destination succed or not
- # (succed, 1, failed, 0).
+ # Store tuples of timestamp and whether the destination succeed or not
+ # (succeed, 1, failed, 0).
# Initialize it as if it never failed.
self._attempts = collections.deque(
[
@@ -268,7 +268,7 @@ class Destination:
And False otherwise.
When the destination is tried again after the consecutive failures,
- the time to try again is incremented and resetted as soon as the
+ the time to try again is incremented and reset as soon as the
destination does not fail.
"""
# NOTE: does a destination fail because several threads are using
diff --git a/sbws/lib/relaylist.py b/sbws/lib/relaylist.py
index 0128786..698fb8e 100644
--- a/sbws/lib/relaylist.py
+++ b/sbws/lib/relaylist.py
@@ -138,7 +138,7 @@ class Relay:
def consensus_bandwidth_is_unmeasured(self):
# measured appears only votes, unmeasured appears in consensus
# therefore is_unmeasured is needed to know whether the bandwidth
- # value in consensus is comming from bwauth measurements or not.
+ # value in consensus is coming from bwauth measurements or not.
return self._from_ns("is_unmeasured")
@property
diff --git a/sbws/lib/relayprioritizer.py b/sbws/lib/relayprioritizer.py
index f70c7a6..8f3bf96 100644
--- a/sbws/lib/relayprioritizer.py
+++ b/sbws/lib/relayprioritizer.py
@@ -100,7 +100,7 @@ class RelayPrioritizer:
those measurements.
:param bool prioritize_result_error: whether prioritize or not
- measurements that did not succed.
+ measurements that did not succeed.
:param bool return_fraction: whether to return only a fraction of the
relays seen in the network or return all.
@@ -177,7 +177,7 @@ class RelayPrioritizer:
# In a future refactor, a new attribute should not be created,
# then no need to remove it.
del relay.priority
- # Increment the number of times a realy was "prioritized" to be
+ # Increment the number of times a really was "prioritized" to be
# measured.
relay.increment_relay_recent_priority_list()
yield relay
diff --git a/sbws/lib/resultdump.py b/sbws/lib/resultdump.py
index e60f3bc..b168cbd 100644
--- a/sbws/lib/resultdump.py
+++ b/sbws/lib/resultdump.py
@@ -130,7 +130,7 @@ def trim_results_ip_changed(
return new_results_dict
if on_changed_ipv6 is True:
log.warning(
- "Reseting bandwidth results when IPv6 changes,"
+ "Resetting bandwidth results when IPv6 changes,"
" is not yet implemented."
)
return result_dict
@@ -258,7 +258,7 @@ class Result:
"""
Initializes a ``Result.Relay``.
- .. note:: in a future refactor the attributes should be dinamic
+ .. note:: in a future refactor the attributes should be dynamic
to easy adding/removing them.
They are shared by :class:`~sbws.lib.relaylist.Relay` and
:class:`~sbws.lib.v3bwfile.V3BWLine` and there should not be
@@ -283,7 +283,8 @@ class Result:
def __init__(self, relay, circ, dest_url, scanner_nick, t=None):
"""
- Initilizes the measurement and the relay with all the relay attributes.
+ Initializes the measurement and the relay with all the relay
+ attributes.
"""
self._relay = Result.Relay(
relay.fingerprint,
@@ -351,7 +352,7 @@ class Result:
@property
def relay_recent_measurement_attempt(self):
- """Returns the relay recent measurements attemps.
+ """Returns the relay recent measurements attempts.
It is initialized in :class:`~sbws.lib.relaylist.Relay` and
incremented in :func:`~sbws.core.scanner.main_loop`.
@@ -614,7 +615,7 @@ class ResultErrorSecondRelay(ResultError):
the second relay is an exit without `bad` flag and can exit to port 443.
- If the relay to measure is an exit, the second relay is not an exit.
- It is instanciated in :func:`~sbws.core.scanner.measure_relay`.
+ It is instantiated in :func:`~sbws.core.scanner.measure_relay`.
.. note:: this duplicates code and add more tech-debt,
since it's the same as the other
@@ -666,7 +667,7 @@ class ResultErrorDestination(ResultError):
"""
Error when there is not a working destination Web Server.
- It is instanciated in :func:`~sbws.core.scanner.measure_relay`.
+ It is instantiated in :func:`~sbws.core.scanner.measure_relay`.
.. note:: this duplicates code and add more tech-debt,
since it's the same as the other
diff --git a/sbws/lib/v3bwfile.py b/sbws/lib/v3bwfile.py
index 45a974b..6010099 100644
--- a/sbws/lib/v3bwfile.py
+++ b/sbws/lib/v3bwfile.py
@@ -56,7 +56,7 @@ HEADER_KEYS_V1_1_ORDERED = ["version"]
# They can also be pass as an argument to `Header` to overwrite default values,
# what is done in unit tests.
# `latest bandwidth` is special cause it gets its value from timestamp, which
-# is not a KeyValue, but it's always pass as an agument.
+# is not a KeyValue, but it's always pass as an argument.
# It could be separaed in other list, but so far there is no need, cause:
# 1. when it's pass to the Header to initialize it, it's just ignored.
# 2. when the file is created, it's took into account.
@@ -175,7 +175,7 @@ LINE_TERMINATOR = TERMINATOR + LINE_SEP
# KeyValue separator in Bandwidth Lines
BWLINE_KEYVALUES_SEP_V1 = " "
-# not inclding in the files the extra bws for now
+# not including in the files the extra bws for now
BWLINE_KEYS_V0 = ["node_id", "bw"]
BWLINE_KEYS_V1_1 = [
"master_key_ed25519",
@@ -590,7 +590,7 @@ class V3BWHeader(object):
return len(self.__str__().split(LINE_SEP))
def add_stats(self, **kwargs):
- # Using kwargs because attributes might chage.
+ # Using kwargs because attributes might change.
[
setattr(self, k, str(v))
for k, v in kwargs.items()
@@ -958,7 +958,7 @@ class V3BWLine(object):
@staticmethod
def rtt_from_results(results):
- # convert from miliseconds to seconds
+ # convert from milliseconds to seconds
rtts = [(round(rtt * 1000)) for r in results for rtt in r.rtts]
rtt = round(median(rtts)) if rtts else None
return rtt
diff --git a/sbws/util/fs.py b/sbws/util/fs.py
index f079219..7a9660d 100644
--- a/sbws/util/fs.py
+++ b/sbws/util/fs.py
@@ -11,7 +11,7 @@ Disk space requirements
v3bw files: the maximum space required is ~{mb_bw} MB, after {d_bw} days.
result files: the maximum space required is ~{mb_results} MB, after {d_r} days.
tor directory: the space required is ~{mb_tor} MB.
-code and depenencies: the space required is ~{mb_code} MB
+code and dependencies: the space required is ~{mb_code} MB
Total disk space required is: ~{mb_total} MB
"""
@@ -28,7 +28,7 @@ def sbws_required_disk_space(conf):
size_v3bw_file = 7500 * 220
# default crontab configuration will run genenerate every hour
num_v3bw_files_day = 24
- # ~1000 is the length of a line when the result is successfull
+ # ~1000 is the length of a line when the result is successful
# ~4550 is the number of lines of the biggest result file
size_result_file = 4550 * 1000
num_result_files_day = 1
@@ -66,7 +66,7 @@ def sbws_required_disk_space(conf):
text_dict["mb_results"] = round(results_max_space_after_delete / 1000 ** 2)
text_dict["d_r"] = results_delete_after_days
# not counted rotated files and assuming that when it is not rotated the
- # size will be aproximately 10MiB
+ # size will be approximately 10MiB
space_log_files = 0
if conf.getboolean("logging", "to_file"):
size_log_file = conf.getint("logging", "to_file_max_bytes")
diff --git a/sbws/util/stem.py b/sbws/util/stem.py
index f2bea86..cecd5d7 100644
--- a/sbws/util/stem.py
+++ b/sbws/util/stem.py
@@ -296,7 +296,7 @@ def get_socks_info(controller):
except SocketClosed as e:
if not settings.end_event.is_set():
log.debug(e)
- # This might need to return the eception if this happen in other cases
+ # This might need to return the exception if this happen in other cases
# than when stopping the scanner.
except ControllerError as e:
log.debug(e)
@@ -359,7 +359,7 @@ def is_torrc_starting_point_set(tor_controller):
value_set = tor_controller.get_conf(k)
if v != value_set:
log.exception(
- "Uncorrectly configured %s, should be %s, is %s",
+ "Incorrectly configured %s, should be %s, is %s",
k,
v,
value_set,
diff --git a/tests/integration/chutney_data/client_bwscanner.tmpl b/tests/integration/chutney_data/client_bwscanner.tmpl
index dc6d0d8..7821858 100644
--- a/tests/integration/chutney_data/client_bwscanner.tmpl
+++ b/tests/integration/chutney_data/client_bwscanner.tmpl
@@ -3,7 +3,7 @@ SocksPort $socksport
#NOTE: Setting TestingClientConsensusDownloadSchedule doesn't
# help -- dl_stats.schedule is not DL_SCHED_CONSENSUS
-# at boostrap time.
+# at bootstrap time.
# Try to download after:
# the minimum initial consensus time to start with,
# a few eager fetches,
diff --git a/tests/integration/run.sh b/tests/integration/run.sh
index 90a5322..f31684f 100755
--- a/tests/integration/run.sh
+++ b/tests/integration/run.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Instead of exiting inmmediately when any of this commands fail,
+# Instead of exiting immediately when any of this commands fail,
# the scanner, generate and coverage lines could continue and store there was
# an error on that command. It's just simpler with `-e`.
set -ex
diff --git a/tests/unit/core/test_generate.py b/tests/unit/core/test_generate.py
index 539bf79..5fe2e6e 100644
--- a/tests/unit/core/test_generate.py
+++ b/tests/unit/core/test_generate.py
@@ -14,7 +14,7 @@ def test_gen_parser_arg_round_digs():
parent_parser = argparse.ArgumentParser(prog="sbws")
subparsers = parent_parser.add_subparsers(help="generate help")
parser_generate = gen_parser(subparsers)
- # Explicitely set empty arguments, otherwise pytest will use pytest
+ # Explicitly set empty arguments, otherwise pytest will use pytest
# arguments
args = parser_generate.parse_args([])
assert args.round_digs == PROP276_ROUND_DIG
@@ -29,6 +29,6 @@ def test_gen_parser_arg_round_digs():
# or use the short version
args = parser_generate.parse_args(["-r", str(TORFLOW_ROUND_DIG)])
assert args.round_digs == TORFLOW_ROUND_DIG
- # or use round-digs explicitely
+ # or use round-digs explicitly
args = parser_generate.parse_args(["--round-digs", str(PROP276_ROUND_DIG)])
assert args.round_digs == PROP276_ROUND_DIG
diff --git a/tests/unit/lib/test_destination.py b/tests/unit/lib/test_destination.py
index 99eae7a..2b329d2 100644
--- a/tests/unit/lib/test_destination.py
+++ b/tests/unit/lib/test_destination.py
@@ -57,7 +57,7 @@ def test_destination_is_functional():
d.add_success()
assert not d._are_last_attempts_failures()
assert d.is_functional()
- # And the delta to try is resetted
+ # And the delta to try is reset
assert not d._is_last_try_old_enough()
# When the delta time to retry a destination increase too much,
diff --git a/tests/unit/lib/test_relaylist.py b/tests/unit/lib/test_relaylist.py
index 0d1c6ee..3ce61d1 100644
--- a/tests/unit/lib/test_relaylist.py
+++ b/tests/unit/lib/test_relaylist.py
@@ -4,7 +4,7 @@ from datetime import datetime
# When datetime is imported as a class (`from datetime import datetime`) it can
# not be mocked because it is a built-in type. It can only be mocked when
# imported as module.
-# freezegun is able to mock any datetime object, it also allows comparations.
+# freezegun is able to mock any datetime object, it also allows comparisons.
from freezegun import freeze_time
from sbws.lib.relaylist import Relay, RelayList
diff --git a/tests/unit/lib/test_resultdump.py b/tests/unit/lib/test_resultdump.py
index 2a5f7f6..ea1a035 100644
--- a/tests/unit/lib/test_resultdump.py
+++ b/tests/unit/lib/test_resultdump.py
@@ -47,7 +47,7 @@ def test_trim_results_ip_changed_on_changed_ipv6(
# There might be other logs from other threads.
with caplog.at_level(logging.WARNING):
assert (
- "Reseting bandwidth results when IPv6 changes, "
+ "Resetting bandwidth results when IPv6 changes, "
"is not yet implemented.\n" in caplog.text
)
diff --git a/tests/unit/lib/test_v3bwfile.py b/tests/unit/lib/test_v3bwfile.py
index cb26474..6841e8f 100644
--- a/tests/unit/lib/test_v3bwfile.py
+++ b/tests/unit/lib/test_v3bwfile.py
@@ -369,7 +369,7 @@ def test_torflow_scale(mock_consensus, datadir, tmpdir, conf):
results = load_result_file(str(datadir.join("results.txt")))
# Since v1.1.0, it'll write bw=1 if the minimum percent of measured relays
# wasn't reached. Therefore mock the consensus number.
- # Because the consensus number is mocked, it'll try to read the sate path.
+ # Because the consensus number is mocked, it'll try to read the state path.
# Obtain it from conf, so that the root directory exists.
v3bwfile = V3BWFile.from_results(
results,
diff --git a/tests/unit/util/test_state.py b/tests/unit/util/test_state.py
index 3937ce5..0f1f248 100644
--- a/tests/unit/util/test_state.py
+++ b/tests/unit/util/test_state.py
@@ -79,7 +79,7 @@ def test_state_iter(tmpdir):
def test_two_instances(tmpdir):
- """Test that 2 different intances don't overwrite each other"""
+ """Test that 2 different instances don't overwrite each other"""
s1 = State(os.path.join(str(tmpdir), "state.dat"))
s2 = State(os.path.join(str(tmpdir), "state.dat"))
s1["x"] = "foo"
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits