Repository: HypothesisWorks/hypothesis

Issue:
Spelling
I can reorder/squish if requested...



Discussion:
My two cents: there are some useful spelling corrections here, but also a lot of changes that either make the code worse (single-letter variable names) or don’t seem to add anything (lots of changes that are just renamed variables).

A quick glance at the tests suggests that renaming the variables has introduced several bugs, because you’ve missed a few. I’m not a fan of commits that just rename variables – potential pain, but no obvious gain.

If it was me, I’d back out most of the changes, and leave only those which correct genuine spelling errors.

I'm happy to defer to @DRMacIver if he prefers this style -- it is his code, after all. :-)


Resolving patch:
diff --git a/src/hypothesis/internal/charmap.py b/src/hypothesis/internal/charmap.py
--- a/src/hypothesis/internal/charmap.py
+++ b/src/hypothesis/internal/charmap.py
@@ -50,7 +50,7 @@ def charmap():
                     rs[-1][-1] += 1
                 else:
                     rs.append([i, i])
-            # We explicitly set the mtime to an arbitary value so as to get
+            # We explicitly set the mtime to an arbitrary value so as to get
             # a stable format for our charmap.
             data = sorted(
                 (k, tuple((map(tuple, v))))
diff --git a/src/hypothesis/internal/conjecture/minimizer.py b/src/hypothesis/internal/conjecture/minimizer.py
--- a/src/hypothesis/internal/conjecture/minimizer.py
+++ b/src/hypothesis/internal/conjecture/minimizer.py
@@ -25,7 +25,7 @@
 
 That is, given a block of bytes of size n, and a predicate that accepts such
 blocks, it tries to find a lexicographically minimal block of that size
-that satisifies the predicate, starting from that initial starting point.
+that satisfies the predicate, starting from that initial starting point.
 
 Assuming it is allowed to run to completion (which due to the way we use it it
 actually often isn't) it makes the following guarantees, but it usually tries
@@ -170,7 +170,7 @@ def run(self):
 # Table of useful small shrinks to apply to a number.
 # The idea is that we use these first to see if shrinking is likely to work.
 # If it is, we try a full shrink. In the best case scenario this speeds us
-# up by a factor of about 25. It will occasonally cause us to miss
+# up by a factor of about 25. It will occasionally cause us to miss
 # shrinks that we could have succeeded with, but oh well. It doesn't fail any
 # of our guarantees because we do try to shrink to -1 among other things.
 small_shrinks = [
diff --git a/src/hypothesis/strategies.py b/src/hypothesis/strategies.py
--- a/src/hypothesis/strategies.py
+++ b/src/hypothesis/strategies.py
@@ -1039,7 +1039,8 @@ def data():
     It can only be used within @given, not find. This is because the lifetime
     of the object cannot outlast the test body.
 
-    See the rest of the documentation for more complete information.
+    See :ref:`the rest of the documentation <interactive-draw>` for more
+    complete information.
 
     """
     from hypothesis.control import note


Test patch:
diff --git a/examples/test_rle.py b/examples/test_rle.py
--- a/examples/test_rle.py
+++ b/examples/test_rle.py
@@ -25,7 +25,7 @@
 This demonstrates the useful decode(encode(x)) == x invariant that is often
 a fruitful source of testing with Hypothesis.
 
-It also has an example of testing invariants in resposne to changes in the
+It also has an example of testing invariants in response to changes in the
 underlying data.
 
 """
diff --git a/tests/cover/test_strategytests.py b/tests/cover/test_strategytests.py
--- a/tests/cover/test_strategytests.py
+++ b/tests/cover/test_strategytests.py
@@ -15,7 +15,7 @@
 #
 # END HEADER
 
-# most interesting tests of this nature are exected in nocover, but we have
+# most interesting tests of this nature are expected in nocover, but we have
 # a few here to make sure we have coverage of the strategytests module itself.
 
 
diff --git a/tests/nocover/test_strategy_state.py b/tests/nocover/test_strategy_state.py
--- a/tests/nocover/test_strategy_state.py
+++ b/tests/nocover/test_strategy_state.py
@@ -72,13 +72,13 @@ def set_database(self):
         self.teardown()
         self.database = ExampleDatabase()
 
-    @rule(strat=strategies, r=integers(), mshr=integers(0, 100))
-    def find_constant_failure(self, strat, r, mshr):
+    @rule(strat=strategies, r=integers(), max_shrinks=integers(0, 100))
+    def find_constant_failure(self, strat, r, max_shrinks):
         with settings(
             verbosity=Verbosity.quiet, max_examples=1,
             min_satisfying_examples=0,
             database=self.database,
-            max_shrinks=mshr,
+            max_shrinks=max_shrinks,
         ):
             @given(strat)
             @seed(r)
@@ -92,14 +92,14 @@ def test(x):
 
     @rule(
         strat=strategies, r=integers(), p=floats(0, 1),
-        mex=integers(1, 10), mshr=integers(1, 100)
+        max_examples=integers(1, 10), max_shrinks=integers(1, 100)
     )
-    def find_weird_failure(self, strat, r, mex, p, mshr):
+    def find_weird_failure(self, strat, r, max_examples, p, max_shrinks):
         with settings(
-            verbosity=Verbosity.quiet, max_examples=mex,
+            verbosity=Verbosity.quiet, max_examples=max_examples,
             min_satisfying_examples=0,
             database=self.database,
-            max_shrinks=mshr,
+            max_shrinks=max_shrinks,
         ):
             @given(strat)
             @seed(r)