diff --git a/mathics/builtin/datentime.py b/mathics/builtin/datentime.py index 11a8f7fdc..c0c1aa858 100644 --- a/mathics/builtin/datentime.py +++ b/mathics/builtin/datentime.py @@ -454,7 +454,7 @@ class DateDifference(Builtin): """ # FIXME: Since timedelta does not use large time units (years, months etc) - # this method can be innacuarate. The example below gives fractional Days + # this method can be inaccurate. The example below gives fractional Days # (20.1666666667 not 20). """ diff --git a/test/builtin/atomic/test_strings.py b/test/builtin/atomic/test_strings.py index bdf4b0d01..959de26da 100644 --- a/test/builtin/atomic/test_strings.py +++ b/test/builtin/atomic/test_strings.py @@ -100,8 +100,8 @@ def test_alphabet(str_expr, str_expected, fail_msg, warnings): "StringContainsQ[{A, Galaxy, Far, Far, Away}, {F ~~ __ ~~ r, aw ~~ ___}]", None, ), - ## Mathematica can detemine correct invalid element in the pattern, it reports error: - ## Element F is not a valid string or pattern element in {F ~~ __ ~~ r, aw ~~ ___}. + # Mathematica can determine correct invalid element in the pattern, it reports error: + # Element F is not a valid string or pattern element in {F ~~ __ ~~ r, aw ~~ ___}. ( 'StringRepeat["x", 0]', ("A positive integer is expected at position 2 in StringRepeat[x, 0].",), diff --git a/test/builtin/calculus/test_integrate.py b/test/builtin/calculus/test_integrate.py index 135e0f932..212e9fb1e 100644 --- a/test/builtin/calculus/test_integrate.py +++ b/test/builtin/calculus/test_integrate.py @@ -17,7 +17,7 @@ def test_integrate(): ( "h=x;Integrate[Do[h=x*h,{5}]; h,x]", "x^7/7", - "a more agressive SymPy translation.", + "a more aggressive SymPy translation.", ), ): session.evaluate("Clear[h]; Clear[g]; Clear[f];") diff --git a/test/builtin/list/test_eol.py b/test/builtin/list/test_eol.py index 51338375a..0b7780ee4 100644 --- a/test/builtin/list/test_eol.py +++ b/test/builtin/list/test_eol.py @@ -50,7 +50,7 @@ "x=.;a=.;b=.;c=.;f=.; g=.;d=.;m=.;n=.;Delete[1 + x ^ (a + b + c), {2, 2, 3}]", None, "1 + x ^ (a + b)", - "Faiing?", + "Failing?", ), ("Delete[f[a, g[b, c], d], {{2}, {2, 1}}]", None, "f[a, d]", None), ( diff --git a/test/builtin/numbers/test_algebra.py b/test/builtin/numbers/test_algebra.py index 701ab4411..826151628 100644 --- a/test/builtin/numbers/test_algebra.py +++ b/test/builtin/numbers/test_algebra.py @@ -23,7 +23,7 @@ def test_collect(): def test_coefficient(): for str_expr, str_expected in ( - # Form 1: Coefficent[expr, form] + # Form 1: Coefficient[expr, form] ( "Coefficient[(x + 2)/(y - 3) + (x + 3)/(y - 2), z, 0]", "(2 + x) / (-3 + y) + (3 + x) / (-2 + y)", @@ -50,7 +50,7 @@ def test_coefficient(): "Coefficient[x^3 - 2 x/y + 3 x z, y]", "0", ), - # Form 2: Coefficent[expr, form, n] + # Form 2: Coefficient[expr, form, n] ( "Coefficient[x^2 + axy^2 - bSin[c], c]", "0", @@ -61,7 +61,7 @@ def test_coefficient(): def test_coefficient_list(): for str_expr, str_expected in ( - # Form 1: Coefficent[expr, form] + # Form 1: Coefficient[expr, form] ( "CoefficientList[x^2 + a x y^2 - b Sin[c], y]", "{-b Sin[c] + x ^ 2, 0, a x}", @@ -359,10 +359,10 @@ def test_fullsimplify(): "Coefficient[3 + x + y, 5]", None, ), - ## This is known bug of Sympy 1.0, next Sympy version will fix it by this commit - ## https://github.com/sympy/sympy/commit/25bf64b64d4d9a2dc563022818d29d06bc740d47 - ("Coefficient[x * y, z, 0]", None, "x y", "Sympy 1.0 retuns 0"), - ## TODO: Support Modulus + # This is known bug of Sympy 1.0, next Sympy version will fix it by this commit + # https://github.com/sympy/sympy/commit/25bf64b64d4d9a2dc563022818d29d06bc740d47 + ("Coefficient[x * y, z, 0]", None, "x y", "Sympy 1.0 returns 0"), + # TODO: Support Modulus # ("Coefficient[(x + 2)^3 + (x + 3)^2, x, 0, {Modulus -> 3, Modulus -> 2, Modulus -> 10}]", # None,"{2, 1, 7}", None), ( diff --git a/test/builtin/numbers/test_diffeqns.py b/test/builtin/numbers/test_diffeqns.py index 7f445957a..b1168ca3a 100644 --- a/test/builtin/numbers/test_diffeqns.py +++ b/test/builtin/numbers/test_diffeqns.py @@ -66,7 +66,7 @@ "DSolve[f[x] == 0, f, {}]", None, ), - # # Order of arguments shoudn't matter + # Order of arguments should not matter ( "DSolve[D[f[x, y], x] == D[f[x, y], y], f, {x, y}]", None, diff --git a/test/builtin/numbers/test_nintegrate.py b/test/builtin/numbers/test_nintegrate.py index b3d9443a0..8e9dee43d 100644 --- a/test/builtin/numbers/test_nintegrate.py +++ b/test/builtin/numbers/test_nintegrate.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- """ -Unit tests for mathics.buitin.numbers.nintegrate +Unit tests for mathics.builtin.numbers.nintegrate NIntegrate[] tests diff --git a/test/builtin/test_comparison.py b/test/builtin/test_comparison.py index a2fc847c6..fc1c4644c 100644 --- a/test/builtin/test_comparison.py +++ b/test/builtin/test_comparison.py @@ -78,13 +78,13 @@ ("g[a]3', "Wo[x] > 3", "isue #797"), - ('Wo["x"]<3', "Wo[x] < 3", "isue #797"), - ('Wo["x"]==3', "Wo[x] == 3", "isue #797"), - ('3>Wo["x"]', "3 > Wo[x]", "isue #797"), - ('30', "Wo[f[x], 2] > 0", "isue #797"), + ('Wo["x"]>3', "Wo[x] > 3", "issue #797"), + ('Wo["x"]<3', "Wo[x] < 3", "issue #797"), + ('Wo["x"]==3', "Wo[x] == 3", "issue #797"), + ('3>Wo["x"]', "3 > Wo[x]", "issue #797"), + ('30', "Wo[f[x], 2] > 0", "issue #797"), # # chained compare ("a != a != b", "False", "Strange MMA behavior"), @@ -180,8 +180,8 @@ def test_sameq(str_lhs, str_rhs, str_expected): [ # UnsameQ returns True with 0 or 1 arguments ("UnsameQ[]", "True"), ("UnsameQ[expr]", "True"), - # With 2 or more argments, UnsameQ returns True if all expressions are - # structurally distinct and False otherwise + # With 2 or more arguments, UnsameQ returns True if all + # expressions are structurally distinct and False otherwise ("x =!= x", "False"), ("x =!= y", "True"), ("1 =!= 2 =!= 3 =!= 4", "True"), diff --git a/test/builtin/test_datentime.py b/test/builtin/test_datentime.py index 374cf174a..386136d90 100644 --- a/test/builtin/test_datentime.py +++ b/test/builtin/test_datentime.py @@ -34,16 +34,19 @@ def test_timeremaining(): def test_timeconstrained1(): """ This test checks that - * TimeConstrained manages to return $Aborted when the + + - ``TimeConstrained`` manages to return ``$Aborted`` when the evaluated expression exceeds the walltime. - * That the evaluation does not proceeds after the walltime. - If `Pause` and TimeConstrained were absolutely accurate, + - That the evaluation does not proceed after the walltime. + + If ``Pause`` and ``TimeConstrained`` were absolutely accurate, `a` should be always less than 11. However, sometimes - the innacuracies in time could allow to reach more than 10 - iterations before get stopped. 20 iterations should be a safe + the inaccuracies in time could allow to reach more than 10 + iterations before being stopped. 20 iterations should be a safe bound. - After `TimeConstrained` returns `$Abort`, iterations should stop, + + After ``TimeConstrained`` returns ``$Abort``, iterations should stop, so if we check one second after the end of the evaluation, `a` should not change its value. """ diff --git a/test/builtin/test_makeboxes.py b/test/builtin/test_makeboxes.py index fdf31e420..c0a853332 100644 --- a/test/builtin/test_makeboxes.py +++ b/test/builtin/test_makeboxes.py @@ -252,7 +252,7 @@ def test_makeboxes_others_fail(str_expr, str_expected, msg): ( r"MakeBoxes[G[F[2.]], StandardForm]", r'RowBox[{"G","[",RowBox[{"F","[","2.","]"}],"]"}]', - "Standard bahaviour", + "Standard behaviour", ), ( r'MakeBoxes[F[x_], fmt_] := "F[" <> ToString[x] <> "]";MakeBoxes[G[F[3.002]], StandardForm]', diff --git a/test/builtin/test_patterns.py b/test/builtin/test_patterns.py index 389dee860..c0b0b4153 100644 --- a/test/builtin/test_patterns.py +++ b/test/builtin/test_patterns.py @@ -49,7 +49,7 @@ def test_replace_all(): "Dispatch[]", "dispatch with 0 arguments", ), - ("Dispatch[a]", None, "Dispatch[a]", "A simbol. Keep unevaluated."), + ("Dispatch[a]", None, "Dispatch[a]", "A symbol. Keep unevaluated."), ("Dispatch[a -> b]", None, "Dispatch[<1>]", "single rule"), ("Dispatch[{}]", None, "{}", "empty rule"), ("Dispatch[{a -> 1}]", None, "Dispatch[<1>]", "single rule"), diff --git a/test/builtin/test_strings.py b/test/builtin/test_strings.py index 06fe91730..061e64925 100644 --- a/test/builtin/test_strings.py +++ b/test/builtin/test_strings.py @@ -323,8 +323,8 @@ def test_private_doctests_operations(str_expr, msgs, str_expected, fail_msg): "StringFreeQ[{A, Galaxy, Far, Far, Away}, {F ~~ __ ~~ r, aw ~~ ___}]", None, ), - ## Mathematica can detemine correct invalid element in the pattern, it reports error: - ## Element F is not a valid string or pattern element in {F ~~ __ ~~ r, aw ~~ ___}. + # Mathematica can determine correct invalid element in the pattern, it reports error: + # Element F is not a valid string or pattern element in {F ~~ __ ~~ r, aw ~~ ___}. ('StringMatchQ["abc1", LetterCharacter]', None, "False", None), ('StringMatchQ["abc", "ABC"]', None, "False", None), ('StringMatchQ["abc", "ABC", IgnoreCase -> True]', None, "True", None), diff --git a/test/core/test_streams.py b/test/core/test_streams.py index e7ead1cd1..54fbb8914 100644 --- a/test/core/test_streams.py +++ b/test/core/test_streams.py @@ -23,7 +23,7 @@ def test_path_search(): for expect_find, expect_temporary, filename, assert_msg in ( (True, False, "fortytwo`", "should find with .m extension"), (False, False, "fortytwo", "should not find without backtick (`) added"), - (True, False, "recursive-gcd`", "should find wit .wl extension"), + (True, False, "recursive-gcd`", "should find with .wl extension"), ): resolved_file, is_temporary = path_search(filename) assert expect_find == bool(resolved_file), assert_msg diff --git a/test/eval/test_patterns.py b/test/eval/test_patterns.py index bb2ae9efb..865080f06 100644 --- a/test/eval/test_patterns.py +++ b/test/eval/test_patterns.py @@ -20,7 +20,7 @@ def check_pattern(str_expr, str_pattern): expr = parse(defintions, MathicsSingleLineFeeder(str_expr)) pattern = ExpressionPattern(parse(defintions, MathicsSingleLineFeeder(str_pattern))) ret = Matcher(pattern, session.evaluation).match(expr, session.evaluation) - assert ret == True + assert ret is True @pytest.mark.parametrize(