Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:not': 0.03; 'broken': 0.04; 'failing': 0.07; 'pypi': 0.07; 'assumed': 0.09; "'__doc__',": 0.16; '36,': 0.16; 'from:addr:pobox.com': 0.16; 'from:addr:skip': 0.16; 'skip:" 70': 0.16; 'tracing': 0.16; 'sender:addr:gmail.com': 0.17; '(the': 0.22; '>>>': 0.22; 'example': 0.22; 'import': 0.22; 'install': 0.23; 'skip': 0.24; 'looks': 0.24; 'skip:" 40': 0.26; 'this:': 0.26; 'downloaded': 0.26; 'somewhere': 0.26; 'installed': 0.27; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; "skip:' 10": 0.31; 'trace': 0.31; 'file': 0.32; 'run': 0.32; '(most': 0.33; 'skip:d 20': 0.34; 'test': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'should': 0.36; 'unit': 0.37; 'being': 0.38; 'to:addr:python-list': 0.38; 'recent': 0.39; 'to:addr:python.org': 0.39; 'first': 0.61; 'different': 0.65; 'here': 0.66; 'from.': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=l6S3C8kuvqvg9xgh6jAlVA62CewfIueracQPJvHc2cM=; b=IEZKB+kKeJ6XQ6w2q/4AJFEbXu+jXCdrX+5bfv4ipW1OnfkvNNc+EmLZ110ERN3HkC 26Wv40tQ1c08eIGRtlEZFO5h0orEGCTcvNlIx6kihdKpgdZhTIAA2ZPE2waaNRt404Aq N4+5zZwC+2V9jLJjFIsLJBLuTiAhnjgHecVXCWFL1WzHsHTRKe5tn3Prjv5BJAwQjDVP h/b7wUtMP/tRjYtQ8TgjCb7Bs70NbJmMYHaKPBzByNuZtfJ99kGnuVjKeVqjJRqx30BZ YYAIKZcu7rJjNmsO/pf1MdGgXfgBmCMKBY9Mvt3PNUOX9lyyrSPQCf9BxD5ChSLfxy9Q sKhg== MIME-Version: 1.0 X-Received: by 10.42.201.134 with SMTP id fa6mr2072575icb.73.1408457931051; Tue, 19 Aug 2014 07:18:51 -0700 (PDT) Sender: skip.montanaro@gmail.com Date: Tue, 19 Aug 2014 09:18:51 -0500 X-Google-Sender-Auth: -RDIooK_fbbwW8Z8NgRaeiACU-c Subject: MacroPy tracing not working for me... From: Skip Montanaro To: Python Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 41 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1408457933 news.xs4all.nl 2899 [2001:888:2000:d::a6]:46514 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:76567 I just downloaded and installed MacroPy (pip install --user MacroPy), with an intention of sticking a "with trace:" inside a failing unit test being run with nosetests. If I understood the example on the PyPI page correctly, I should have been able to do this: import macropy.tracing with macropy.tracing.trace: ... my broken code here ... (The first example is just "with trace: ..." and doesn't say where the trace object came from. I assumed it came from the tracing module.) Instead, I got a traceback: Traceback (most recent call last): File "/opt/TWWfsw/nose11/lib/python27/nose/case.py", line 197, in runTest self.test(*self.arg) File "/home/skipm/src/git/python/snake/tests/test_contracts/test_sessiontimes.py", line 36, in test_grain_break_session with macropy.tracing.trace: AttributeError: __exit__ Inspecting the trace object in at the REPL, I see nothing which looks like __exit__: >>> import macropy.tracing >>> dir(macropy.tracing.trace) ['__call__', '__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__getitem__', '__hash__', '__init__', '__module__', '__name__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'func', 'msg'] >>> type(macropy.tracing.trace) Is there a different "trace" object somewhere in the macropy package I should be using? Thx, Skip