Published on

Exploring AltWalker 0.4.0: What’s New?

Support for Python 3.12, new fixtures, and the LiveViewer release

In this article, we’ll dive into the latest features and enhancements that have been introduced in AltWalker 0.4.0, including support for Python 3.12, the introduction of new fixtures, and the highly anticipated LiveViewer release.

Support for Python 3.12

The load_module() method has been deprecated and is scheduled for removal in Python 3.12. AltWalker has transitioned to using exec_module instead. Additionally, the verify, walk, and online commands now include the --import-mode option, offering the following values:

  • importlib: This mode employs importlib to import test modules.
  • prepend: The directory containing each module is prepended to the end of sys.path if not already there.
  • append: The directory containing each module is appended to the end of sys.path if not already there.

Introducing New Fixtures

One of the major highlights in AltWalker 0.4.0 is the introduction on two new fixtures:

  • beforeStep: Will be executed before every step.
  • afterStep: Will be executed after every step.

You can define these fixtures in your test code like this:

# tests/test.py

def beforeStep():
    """Will be executed before every step."""

def afterStep():
    """Will be executed after every step."""


class ModelA:

    def beforeStep():
        """Will be executed before every step from this model."""

    def afterStep():
        """Will be executed after every step from this model."""

    # ...

These fixtures offer you the flexibility to customize behavior before and after individual steps, enhancing the control and functionality of your test suite.

Check out the documentation for more details.

LiveViewer Initial Release

LiveViewer Recording.

AltWalker’s LiveViewer is a web application for visualizing your test runs in real-time. It brings a new dimension to your testing process, allowing you to monitor your test executions with ease.

Visit the LiveViewer app at https://altwalker.github.io/live-viewer/.

If you’re eager to dive into the initial release of AltWalker’s LiveViewer, you can find the repository here: https://www.github.com/altwaler/live-viewer/.

See also

GitHub Actions for Altwalker

This tutorial will guide you through the process of setting up a GitHub workflow to automatically run your AltWalker tests whenever changes are pushed to your repository.

Mastering the Arrange, Act, and Assert Pattern

Unit testing is a vital aspect of software development, ensuring code correctness and reliability. However, writing clear and effective tests can be challenging as projects grow in complexity. To simplify this process, developers use the “Arrange, Act, and Assert” (AAA) pattern.