[TIP] [coverage] Why is --source=. not the default?

c.buhtz at posteo.jp c.buhtz at posteo.jp
Mon Jan 16 22:14:26 PST 2023


Hello Ned,

thanks for the feedback.

On 2023-01-16 18:43 Ned Batchelder <ned at nedbatchelder.com> wrote:
> It might be that the time has come to change
> the default to "--source=."   But I also know that these kinds of
> changes lead to unintended consequences, and people being surprised
> by changed defaults

You could define a deprecated-phase. I know this from pip for example.
You could give a warning message and a deadline in it that this
behavior will change. I do often orientate myself on Debian Release
cycles. So you could make it a two year deadline. Or a bit longer, you
wait 2 Debian releases which would be round about 4 years. Then you on
the saver side. ;)

You could also implement a "--new-behavior" (or something like this)
switch until that deadline. And after the deadline a "--old-behavior". I
know something like this from "rsync" in context of its two ways of
"argument protection". Here the transition phase was nearly 10 years.

Sidenote: Please be aware that people often use the so called "src
layout" these days. Some do use other layouts for there project folder.
So there should be kind of a discovery feature. I assume you could use
the discovery from the unittest package and don't have to implement
that for yourself.

kind
Christian



More information about the testing-in-python mailing list