Testing

Common testing support module

Common testing support module providing defaults, functions and mocks.

class orion.testing.MockDatetime[source]

Fake Datetime

Methods

utcnow()

Return our random/fixed datetime

classmethod utcnow()[source]

Return our random/fixed datetime

orion.testing.create_experiment(exp_config=None, trial_config=None, statuses=None, knowledge_base=None)[source]

Context manager for the creation of an ExperimentClient and storage init

orion.testing.default_datetime()[source]

Return default datetime

orion.testing.falcon_client(exp_config=None, trial_config=None, statuses=None)[source]

Context manager for the creation of an ExperimentClient and storage init

orion.testing.generate_benchmark_experiments_trials(benchmark_algorithms, experiment_config, trial_config, task_number, max_trial)[source]

Return a list of experiments and trials for a benchmark

orion.testing.generate_trials(trial_config=None, statuses=None, exp_config=None, max_attemtps=50)[source]

Generate Trials with different configurations

orion.testing.mock_space_iterate(monkeypatch)[source]

Force space to return seeds as samples instead of actually sampling

This is useful for tests where we want to get params we can predict (0, 1, 2, …)

orion.testing.mocked_datetime(monkeypatch)[source]

Make datetime.datetime.utcnow() return an arbitrary date.