[rfc] question about tests in blackbox/test_diff.py
Alexander Belchenko
bialix at ukr.net
Thu Dec 7 17:26:33 GMT 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Looking at tests in blackbox/test_diff.py I see something strange.
At first declared
class TestDiff(ExternalBase)
then declared 3 another classes (1 without new tests and 2 with new
tests), and each next class use TestDiff as ancestor.
All this classes use method make_example_branch to setup at the start of
tests.
But really strange thing here that only one class need to subclass
TestDiff -- it's the test TestCheckoutDiff -- because only this class
don't provide new test methods but instead change functionality of
helper methods like make_example_branch and others.
2 other classes (TestDiffLabels, TestExternalDiff) subclass this class
only for using unmodified make_example_branch method.
I think it's wrong, because 2 latter classes reinvoke base tests from
TestDiff. So this is only waste the time of selftest. And if any test in
TestDiff will fails it also fails in this classes as well, provide only
noise.
I think we need create one base class (e.g. TestDiffBase) with helper
method (make_example_branch) and subclass all other classes correctly:
class TestDiff(TestDiffBase):
class TestCheckoutDiff(TestDiff):
class TestDiffLabels(TestDiffBase):
class TestExternalDiff(TestDiffBase):
What you think?
Alexander
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFeE7JzYr338mxwCURAnUOAJ9g70ue7iasht6/wOboLfYF4xz97QCeKXF6
OCCffKTFp8mb1W1FTmZZwP0=
=MpEY
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list