Pantestudines

Pantestudines or Pan-Testudines is the proposed group of all reptiles more closely related to turtles than to any other living animal. It includes both modern turtles (crown group turtles, also known as Testudines) and all of their extinct relatives (also known as stem-turtles). Pantestudines with a complete shell are placed in the clade Testudinata.

Classification
The identity of the ancestors and closest relatives of the turtle lineage was a longstanding scientific mystery, though new discoveries and better analyses in the early 21st century began to clarify turtle relationships. They had traditionally been considered relatives of the captorhinids, which also possessed an anapsid skull configuration. Later, the consensus shifted towards Testudinata's placement within Parareptilia, another "anapsid" clade.

Analysis of fossil data has shown that turtles are likely diapsid reptiles, most closely related either to the archosaurs (crocodiles, bird, and relatives) or the lepidosaurs (lizards, tuatara, and relatives). An early proponent of this scenario was Goodrich (1916), who defended a diapsid origin of turtles based on morphological evidence. Genetic analysis strongly favors the hypothesis that turtles are the closest relatives of the archosaurs, though studies using only fossil evidence often continue to recover them as relatives of lepidosaurs or as non-diapsids. Studies using only fossils, as well as studies using a combination of fossil and genetic evidence, both suggest that sauropterygians, the group of prehistoric marine reptiles including the plesiosaurs and the often superficially turtle-like placodonts, are themselves stem-turtles. This hypothesis had been previously investigated in the 19th century.

Lee (2001) found that forcing the turtle group to cluster with archosauromorphs resulted in Rhynchosauria becoming Testudinata's sister clade. Forcing a relationship with lepidosaurs resulted in turtles being close relatives of sauropterygians within Lepidosauromorpha. The anapsid hypothesis was still better supported, although an archosauromorph affinity could not be rejected.

Although morphology-based analyses usually do not support a turtle-archosaur clade (Archelosauria), Bhullar & Bever (2009) identified a laterosphenoid bone, typical of Archosauriformes, in the stem-turtle Proganochelys. It may serve as a synapomorphy for this proposed clade.

The cladogram shown below follows the most likely result found by an analysis of turtle relationships using both fossil and genetic evidence by M.S. Lee, in 2013. This study found Eunotosaurus, usually regarded as a turtle relative, to be only very distantly related to turtles in the clade Parareptilia. However, Lee discusses the necessity to investigate the possibility that parareptiles are actually archelosaurs instead of non-saurian sauropsids.

The cladogram below follows the most likely result found by another analysis of turtle relationships, this one using only fossil evidence, published by Rainer Schoch and Hans-Dieter Sues in 2015. This study found Eunotosaurus to be an actual early stem-turtle, though other versions of the analysis found weak support for it as a parareptile.

Bever et al. (2015) redescribed the skull of Eunotosaurus, identifying a lower temporal fenestra, with a juvenile specimen also having visible upper temporal fenestrae. This instigated a reinterpretation of this taxon as a diapsid instead of an anapsid. Their phylogenetic analyses strongly supported Eunotosaurus's state as a stem-turtle and the placement of Pantestudines in Diapsida, though they couldn't determine a well-defined position within that clade. Sauropterygia and Acerosodontosaurus also end up as possible stem-turtles in some of the trees.

Benton (2015) compiled 2 synapomorphies of Ankylopoda (which would also include Sauropterygia, Thalattosauria and Ichthyosauria close to lepidosaurs): prootic-parietal contact and hooked fifth metatarsal.

Time-calibrated phylogeny recovered by Shaffer et al. (2017) dated the split of Pantestudines from its sister clade (the clade containing archosaurs and all tetrapods more closely related to archosaurs than to any other living animals) to mid-Carboniferous.

Laurin and Piñeiro (2017) placed turtles close to pareiasaurs among parareptiles once more. However, parareptiles were considered derived diapsids in this analysis. The authors interpreted these results as an indication that there might be no conflict between the hypotheses of a parareptilian origin and a diapsid origin. However, this study was criticised in a response paper, which charged that the matrix the paper used was outdated and did not take into account the previous two decades of literature about parareptiles.

The cladogram below follows the analysis of Li et al. (2018). It agrees with the placement of turtles within Diapsida but finds them outside of Sauria (the Lepidosauromorpha + Archosauromorpha clade).

Gardner & Van Franken (2020) criticized the analysis by Li et al., citing problems with the data set and observing that their proposed phylogeny was not supported once the issues were corrected.

Lichtig & Lucas (2021) proposed Pappochelys was related to sauropterygians, Eunotosaurus was a caseid synapsid, and turtles were derived pareiasaur parareptiles close to Anthodon. According to this hypothesis, the turtle shell evolved from a fusion of the ribs to dorsal osteoderms. Odontocheys, which lacked a carapace, is seen as a highly derived taxon instead of a representative of the ancestral state of turtles. The reliability of the molecular support for Archelosauria was also questioned, although Simões et al. (2022) found morphological support for this hypothesis. In their analysis, Pappochelys is the basalmost pantestudine but Eunotosaurus is a basal neodiapsid instead of a stem-turtle, parareptile or synapsid.