Skip to content

Commit 9165b4c

Browse files
committed
rename syntax.testutil to syntax.testingtools (more descriptive)
1 parent 53b885a commit 9165b4c

File tree

9 files changed

+16
-16
lines changed

9 files changed

+16
-16
lines changed

HACKING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Automated tests are in `test`, under the directory whose modules they test. The
7878

7979
For coverage analysis, [`coverage.py`](https://github.com/nedbat/coveragepy) works fine. Block macros do cause [some false negatives](https://github.com/nedbat/coveragepy/issues/1004), but this is minor.
8080

81-
We use a custom testing framework, which lives in the modules `unpythonic.test.fixtures` and `unpythonic.syntax.testutil`. It uses conditions and restarts to communicate between individual tests and the testset, which acts as a reporter.
81+
We use a custom testing framework, which lives in the modules `unpythonic.test.fixtures` and `unpythonic.syntax.testingtools`. It uses conditions and restarts to communicate between individual tests and the testset, which acts as a reporter.
8282

8383
In retrospect, given that the main aim was compact testing syntax for macro-enabled Python code (without installing another import hook, doing which would disable the macro expander), it might have made more sense to make the testing macros compile to [pytest](https://docs.pytest.org/en/latest/). But hey, it's short, may have applications in teaching... and now we can easily write custom runners, since the testing framework is just a MacroPy library.
8484

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ The `with session()` is optional. The human-readable session name is also option
413413

414414
Tests can optionally be grouped into testsets. Each `testset` tallies passed, failed and errored tests within it, and displays the totals when it exits. Testsets can be named and nested.
415415

416-
Testsets also provide the option to locally install a `postproc` handler that gets a copy of each failure or error in that testset (and by default, any of its inner testsets), after the failure or error has been printed. In nested testsets, the dynamically innermost `postproc` wins. A failure is an instance of `unpythonic.syntax.testutil.TestFailure`, and an error is an instance of `unpythonic.syntax.testutil.TestError`. Both inherit from `unpythonic.syntax.testutil.TestingException`.
416+
Testsets also provide the option to locally install a `postproc` handler that gets a copy of each failure or error in that testset (and by default, any of its inner testsets), after the failure or error has been printed. In nested testsets, the dynamically innermost `postproc` wins. A failure is an instance of `unpythonic.test.fixtures.TestFailure`, and an error is an instance of `unpythonic.test.fixtures.TestError`. Both inherit from `unpythonic.test.fixtures.TestingException`.
417417

418418
If you want to set a default global `postproc`, which is used when no local `postproc` is in effect, see the `TestConfig` bunch of constants in `unpythonic.test.fixtures`. It also contains some other configuration options.
419419

unpythonic/syntax/__init__.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@
3131
from .prefix import prefix as _prefix
3232
from .tailtools import (autoreturn as _autoreturn, tco as _tco, # noqa: F401
3333
continuations as _continuations, call_cc)
34-
from .testutil import (test_expr as _test_expr,
35-
test_expr_signals as _test_expr_signals,
36-
test_expr_raises as _test_expr_raises,
37-
test_block as _test_block,
38-
test_block_signals as _test_block_signals,
39-
test_block_raises as _test_block_raises,
40-
fail_expr as _fail_expr,
41-
error_expr as _error_expr,
42-
warn_expr as _warn_expr)
34+
from .testingtools import (test_expr as _test_expr,
35+
test_expr_signals as _test_expr_signals,
36+
test_expr_raises as _test_expr_raises,
37+
test_block as _test_block,
38+
test_block_signals as _test_block_signals,
39+
test_block_raises as _test_block_raises,
40+
fail_expr as _fail_expr,
41+
error_expr as _error_expr,
42+
warn_expr as _warn_expr)
4343
# "where" is only for passing through (export).
4444
from .letdoutil import UnexpandedLetView, _canonize_bindings, where # noqa: F401
4545
from ..dynassign import dyn, make_dynvar

unpythonic/syntax/nb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
from macropy.core.quotes import macros, q, ast_literal # noqa: F401
1212

13-
from .testutil import istestmacro
13+
from .testingtools import istestmacro
1414

1515
def nb(body, args):
1616
p = args[0] if args else q[print] # custom print function hook

unpythonic/syntax/prefix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from macropy.core.walkers import Walker
2424

2525
from .letdoutil import islet, isdo, UnexpandedLetView, UnexpandedDoView
26-
from .testutil import isunexpandedtestmacro
26+
from .testingtools import isunexpandedtestmacro
2727

2828
from ..it import flatmap, rev, uniqify
2929

File renamed without changes.

unpythonic/test/fixtures.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ def returns_normally(expr):
373373
# The magic is, `test[]` lifts its expr into a lambda. When the test runs,
374374
# our arg gets evaluated first, and then its value is passed to us.
375375
#
376-
# To make the test succeed whenever `unpythonic.syntax.testutil._observe`
376+
# To make the test succeed whenever `unpythonic.syntax.testingtools._observe`
377377
# didn't catch an unexpected signal or exception in `expr`, we just ignore
378378
# our arg, and:
379379
return True
@@ -476,7 +476,7 @@ def makeindent(level):
476476
maybe_colorize("BEGIN", TC.BRIGHT, TestConfig.CS.HEADING))
477477

478478
def print_and_proceed(condition):
479-
# The assert helpers in `unpythonic.syntax.testutil` signal only
479+
# The assert helpers in `unpythonic.syntax.testingtools` signal only
480480
# the descendants of `TestingException`, no matter what happens
481481
# inside the test expression.
482482
if isinstance(condition, TestFailure):

unpythonic/test/test_conditions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# `unpythonic` is to write tests that test the testing framework. Currently we
1313
# don't do that. The test framework is considered to change at most slowly, so
1414
# for that, manual testing is sufficient (see commented-out example session in
15-
# `unpythonic.syntax.test.test_testutil`).
15+
# `unpythonic.syntax.test.testing_testingtools`).
1616

1717
from ..syntax import macros, test, test_raises, test_signals, fail # noqa: F401
1818
from .fixtures import session, testset, catch_signals, returns_normally

0 commit comments

Comments
 (0)