Digging into pytest's history #8667
Unanswered
The-Compiler
asked this question in
General
Replies: 1 comment
-
PR for adding this to the docs: #8784 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've always wondered when pytest actually really was born - the first commit in this repository (5992a8e) is from January 2007, and even that commit alone already tells a lot: This repository originally was from the py library (later split off to pytest), and it originally was a SVN revision, migrated to Mercurial, and finally migrated to git.
However, the commit says "create the new development trunk" and is already quite big: 435 files changed, 58640 insertions(+).
So this week, I dug around in various other repositories and mailinglists to find out how it all started. As you might or might not know, pytest originally was born as part of PyPy, to make it easier to write tests for it. Here's what I found it with a bit of digging around:
testsupport
files on top of unittest.py, and as early as June 2003, Holger Krekel (@hpk42) refactored its test framework to clean things up (pypy.tool.test
, but still on top ofunittest.py
, with nothing pytest-like yet, as far as I can tell).pypy.tool.newtest
.utest
, offering plain assertions. This seems like the start of something pytest-like, but unfortunately, I didn't actually find the test runner's code anywhere - the best I could find is this file, but that doesn't seem like a complete test runner at all. What I can see is that there were various efforts by Laura Creighton and Samuele Pedroni (@pedronis) at automatically converting existing tests to the newutest
framework.In September 2004, the
py-dev
mailinglist gets born, which is nowpytest-dev
, but thankfully with all the original archives still intact.Around September/October 2004, the
std
project was renamed topy
, andstd.utest
becamepy.test
. This is also the first time I actually found the entire source code, and I was surprised how much of the API still seems around today:py.path.local
, which we're trying to get rid of (in favour of pathlib) some 16-17 years laterCollector
,FSCollector
,Directory
,PyCollector
,Module
,Class
-x
/--exitfirst
,-l
/--showlocals
,--fulltrace
,--pdb
,-S
/--nocapture
(-s
/--capture=off
today),--collectonly
(--collect-only
today)In the same month, the
py
library gets split off fromPyPy
It seemed to get rather quiet for a while, and I can't really find much between October 2004 (removing
py
from PyPy) and January 2007 (first commit in the now-pytest repository). However, there were various discussions about features/ideas on the mailinglist, and a couple of releases every couple of months:In August 2009, py 1.0.0 was released, introducing a lot of fundamental features:
Even back there, the FAQ said:
and that finally happened in November 2010, when pytest 2.0.0 was released as a package separate from
py
(but still calledpy.test
).pytest
(rather thanpy.test
) as the recommended command-line entry pointSo, do I have an answer to my question "when was pytest started" now? Well, yes and no. It depends what point you really regard as the start of it all - I'd pick Europython 2004, i.e. around June/July 2004 - which means pytest is turning 17 soon, with many of its core concepts still being around! 🎉
If anyone finds something I've missed (e.g. about what happened between mid-2004 and mid-2007), I'd be more than happy to hear about it!
Beta Was this translation helpful? Give feedback.
All reactions