Background Previous experimental research on testosterone (T) and psychological traits is inconclusive. Thus, we performed the first large-scale observational study of the association between T and dispositional optimism / pessimism. Methods We used prospective data from 6,493 primary-care patients (3,840 women) of the DETECT study (Diabetes Cardiovascular Risk-Evaluation: Targets and Essential Data for Commitment of Treatment), including repeated immunoassay-based measurement of serum T and optimism / pessimism assessed by the revised Life-Orientation Test (LOT-R). Cross-sectional and longitudinal associations of baseline T and one-year change in T with optimism and pessimism were investigated using age- and multivariable-adjusted regression models. Results Cross-sectional analyses showed no association of T with optimism or pessimism in both sexes. Longitudinal analyses also showed no association of baseline T with optimism or pessimism at four-year follow-up. Multivariable analyses of total LOT-R score yielded similarly non-significant results (β-coefficient per unit change in T for men: -0.01 (95% CI: -0.24–0.22), women: 0.08 (-0.03–0.20)). Furthermore, change in T was not related to optimism or pessimism at four-year follow-up. Conclusions The present observational study of a large-scale prospective sample showed no association of T with optimism or pessimism. Integrating further experimental and interventional evidence from alternative methodological approaches would strengthen this conclusion and establish stronger evidence about the potential hormonal basis of psychological traits.