From 422a94ea549368a0216406e44094f24405fbeef4 Mon Sep 17 00:00:00 2001 From: "Kevin R. Thornton" Date: Fri, 17 Apr 2026 13:24:39 -0700 Subject: [PATCH] test: extra asserts plus a tidy up --- python_example/maketrees/tests/test_maketrees.py | 1 - src/lib.rs | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/python_example/maketrees/tests/test_maketrees.py b/python_example/maketrees/tests/test_maketrees.py index f959eb2..020438b 100644 --- a/python_example/maketrees/tests/test_maketrees.py +++ b/python_example/maketrees/tests/test_maketrees.py @@ -12,7 +12,6 @@ def test_return_value(): assert ts.num_nodes == 3 assert ts.num_edges == 2 times = ts.tables.nodes.time - print(times) assert len([i for i in times if i == 0.0]) == 2 assert len([i for i in times if i == 1.0]) == 1 diff --git a/src/lib.rs b/src/lib.rs index ec31742..e8b1135 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,4 @@ #![doc = include_str!("../README.md")] - #![deny(missing_docs)] #![deny(rustdoc::broken_intra_doc_links)] @@ -195,6 +194,7 @@ impl SharedTableCollection { /// let pytables = holder.into_python_tables(py).unwrap(); /// pyo3::py_run!(py, pytables, "import tskit; assert isinstance(pytables, /// tskit.TableCollection)"); + /// pyo3::py_run!(py, pytables, "assert pytables.sequence_length == 100.0"); /// }); /// ``` pub fn into_python_tables(self, py: Python<'_>) -> Result, Error> { @@ -220,6 +220,11 @@ impl SharedTableCollection { /// let pytreeseq = holder.into_python_tree_sequence(py).unwrap(); /// pyo3::py_run!(py, pytreeseq, "import tskit; assert isinstance(pytreeseq, /// tskit.TreeSequence)"); + /// pyo3::py_run!(py, pytreeseq, "assert pytreeseq.sequence_length == 100.0"); + /// # pyo3::py_run!(py, pytreeseq, "assert pytreeseq.num_nodes == 0"); + /// # pyo3::py_run!(py, pytreeseq, "assert pytreeseq.num_edges == 0"); + /// # pyo3::py_run!(py, pytreeseq, "assert pytreeseq.num_sites == 0"); + /// # pyo3::py_run!(py, pytreeseq, "assert pytreeseq.num_mutations == 0"); /// }); /// ``` pub fn into_python_tree_sequence(self, py: Python<'_>) -> Result, Error> {