Tests
NoTcl includes a comprehensive test suite covering core functionality, concurrency, and integration with Tcl tools.
Running the tests
To run all tests from the project root:
pytest notcl/tests/
Or with verbose output:
pytest notcl/tests/ -v
Test requirements
Most tests require a Tcl shell to be available. NoTcl includes a custom test shell in utils/test-notcl-tclsh/ that provides additional test commands.
To compile the test shell:
Install Tcl development headers (package
tcl-devon Debian/Ubuntu)Navigate to
utils/test-notcl-tclsh/Run
makeAdd the directory to PATH when running pytest:
PATH=$PATH:/path/to/notcl/utils/test-notcl-tclsh pytest notcl/tests/
When the test shell is not found, tests requiring it are automatically skipped.
Test coverage
The test suite includes:
Basic functionality (
test_tclsh.py): Command evaluation, type conversion, error handling, return value referencesConcurrency (
test_concurrency.py): Nested contexts, parallel tool instances, subprocess compatibilityBridge communication (
test_bridge.py): Low-level message passing between Python and TclCustom tools (
test_custom_tclsh.py): TclRemoteObjRef features, object-oriented API usageType encoding (
test_tclobj.py): Python to Tcl data structure conversion
All tests use the standard Tcl shell (tclsh) as the simplest possible Tcl-based tool, ensuring the library works correctly with minimal dependencies.