[PATCH 1 of 6] util: add event handling mechanism

Matt Mackall mpm at selenic.com
Wed Aug 20 01:22:10 CDT 2014


On Mon, 2014-08-18 at 22:53 -0700, Gregory Szorc wrote:
> On 8/18/2014 10:30 PM, Gregory Szorc wrote:
> > # HG changeset patch
> > # User Gregory Szorc <gregory.szorc at gmail.com>
> > # Date 1408422497 25200
> > #      Mon Aug 18 21:28:17 2014 -0700
> > # Node ID 110ff56e99e2ccff03841cc8baeed7f14c35f69b
> > # Parent  8dda6f6ff564d8fe6ac7b8ce4c74eb9bfb5de14a
> > util: add event handling mechanism
> 
> > diff --git a/tests/test-eventmanager.py b/tests/test-eventmanager.py
> > new file mode 100644
> > --- /dev/null
> > +++ b/tests/test-eventmanager.py
> > @@ -0,0 +1,109 @@
> > +from mercurial.util import event, eventmanager, safehasattr
> > +
> > +import unittest
> > +import silenttestrunner
> > +
> > +class testeventmanager(unittest.TestCase):
> > +    def test_eventsimple(self):
> 
> test-check-commit-hg.t doesn't like this commit because it is
> introducing a function with underscores. But I just stole this naming
> convention from other unittest-based .py tests. I'm not sure who is in
> the wrong here.

The unittest framework is wrong, as is most of the Python standard
library: just compare it to the core language.

More seriously, we DO need to enforce this somewhere, we can't enforce
it in check-code yet, and check-commit isn't remotely sophisticated
enough yet to handle exceptional cases.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list