Skip to content

Commit

Permalink
Fix tests when smac is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
noscode committed Sep 9, 2022
1 parent e709392 commit a5523b8
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,27 +378,28 @@ def test_settings_storage(self):
self.assertRaises(ValueError, check_required_settings, settings)

# Bayesian optimization
settings = SettingsStorage()
settings.custom_filename = os.path.join(
DATA_PATH, "MODELS", "demographic_model_dadi_3pops.py")
settings.global_optimizer = "SMAC_BO_combination"
if dadi_available:
settings.engine = "dadi"
settings.number_of_populations = 2
check_required_settings(settings)
if momi_available:
settings.engine = "momi"
settings.number_of_populations = 5
check_required_settings(settings)
if moments_LD_available:
settings.engine = "momentsLD"
settings.number_of_populations = 5
check_required_settings(settings)
if moments_available:
settings.engine = "moments"
settings.number_of_populations = 5
settings.num_init_const = 10
check_required_settings(settings)
if smac_available:
settings = SettingsStorage()
settings.custom_filename = os.path.join(
DATA_PATH, "MODELS", "demographic_model_dadi_3pops.py")
settings.global_optimizer = "SMAC_BO_combination"
if dadi_available:
settings.engine = "dadi"
settings.number_of_populations = 2
check_required_settings(settings)
if momi_available:
settings.engine = "momi"
settings.number_of_populations = 5
check_required_settings(settings)
if moments_LD_available:
settings.engine = "momentsLD"
settings.number_of_populations = 5
check_required_settings(settings)
if moments_available:
settings.engine = "moments"
settings.number_of_populations = 5
settings.num_init_const = 10
check_required_settings(settings)

def test_old_param_file(self):
# ignore warnings about deprecation and renaming
Expand Down

0 comments on commit a5523b8

Please sign in to comment.