Skip to main content

Crate nautilus_testkit

Crate nautilus_testkit 

Source
Expand description

Test utilities and data management for NautilusTrader.

The nautilus-testkit crate provides testing utilities including test data management, file handling, and common testing patterns. This crate supports robust testing workflows across the entire NautilusTrader ecosystem with automated data downloads and validation:

  • Test data management: Automated downloading and caching of test datasets.
  • File utilities: File integrity verification with SHA-256 checksums.
  • Path resolution: Platform-agnostic test data path management.
  • Precision handling: Support for both 64-bit and 128-bit precision test data.
  • Event collection: Draining and correlating the data events a client emits.
  • Common patterns: Reusable test utilities and helper functions.

§NautilusTrader

NautilusTrader is an open-source, production-grade, Rust-native engine for multi-asset, multi-venue trading systems.

The system spans research, deterministic simulation, and live execution within a single event-driven architecture, providing research-to-live semantic parity.

§Feature Flags

This crate provides feature flags to control source code inclusion during compilation.

  • datasets (enabled by default): Enables test dataset discovery, download, validation, parsing, and loading.
  • testers (enabled by default): Enables test actors, strategies, and in-memory cache backing.
  • python: Enables Python bindings from PyO3.
  • high-precision: Enables high-precision mode to use 128-bit value types.
  • extension-module: Builds the crate as a Python extension module.

Event collection utilities remain available without enabling a feature.

Re-exports§

pub use testers::DataTester;
pub use testers::DataTesterConfig;
pub use testers::ExecTester;
pub use testers::ExecTesterConfig;

Modules§

cache
Stateful cache database test double.
common
components
Stateful actor and strategy test components.
events
Collection utilities for the data events a client emits onto the live runner channel.
files
itch
NASDAQ TotalView-ITCH 5.0 parsing utilities for test data curation.
testers
Test actors and strategies for live testing and development.