Skip to content

Commit

Permalink
Add test case for integer population labels
Browse files Browse the repository at this point in the history
  • Loading branch information
nspope committed Sep 20, 2022
1 parent 566a726 commit 10cfd5f
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions tests/test_slim_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -1990,24 +1990,25 @@ def test_bad_times(self):

def test_population_name(self):
engine = stdpopsim.get_engine("slim")
extended_events = [
stdpopsim.ext.ChangeMutationFitness(
start_time=stdpopsim.ext.GenerationAfter(self.T_mut),
end_time=0,
single_site_id=self.mut_id,
population="not present",
selection_coeff=0.1,
dominance_coeff=0.5,
),
]
with pytest.raises(ValueError, match="is not in demographic model"):
engine.simulate(
demographic_model=self.model,
contig=self.contig,
samples=self.samples,
extended_events=extended_events,
dry_run=True,
)
for pop in ["not present", 0]:
extended_events = [
stdpopsim.ext.ChangeMutationFitness(
start_time=stdpopsim.ext.GenerationAfter(self.T_mut),
end_time=0,
single_site_id=self.mut_id,
population=pop,
selection_coeff=0.1,
dominance_coeff=0.5,
),
]
with pytest.raises(ValueError, match="is not in demographic model"):
engine.simulate(
demographic_model=self.model,
contig=self.contig,
samples=self.samples,
extended_events=extended_events,
dry_run=True,
)

def test_bad_GenerationAfter_times(self):
engine = stdpopsim.get_engine("slim")
Expand Down

0 comments on commit 10cfd5f

Please sign in to comment.