Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder2.hal-mli.net!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!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; 'exception': 0.03; 'operator': 0.03; 'revision': 0.05; 'subject:test': 0.07; '(although': 0.09; 'subject:language': 0.09; 'subject:version': 0.09; 'system;': 0.09; 'thrown': 0.09; '2.7': 0.13; 'fail,': 0.16; 'forgiveness': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'ternary': 0.16; 'mon,': 0.16; 'wrote:': 0.17; 'test.': 0.17; 'tests.': 0.17; 'jan': 0.18; 'tests': 0.18; 'equivalent': 0.20; 'putting': 0.20; 'meant': 0.21; 'libraries': 0.22; 'option.': 0.22; 'errors': 0.23; "i've": 0.23; 'testing': 0.24; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'separate': 0.27; 'wonder': 0.27; 'easiest': 0.27; 'newer': 0.27; 'message- id:@mail.gmail.com': 0.27; 'run': 0.28; "skip:' 10": 0.30; 'expect': 0.31; 'code': 0.31; 'asking': 0.32; 'sources': 0.32; 'running': 0.32; 'platform,': 0.33; 'to:addr:python-list': 0.33; 'likely': 0.33; 'received:google.com': 0.34; 'done': 0.34; 'received:209.85.220': 0.35; 'subject:?': 0.35; 'continue': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'test': 0.36; 'should': 0.36; 'rather': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'unit': 0.38; 'mean': 0.38; 'some': 0.38; 'sure': 0.38; 'to:addr:python.org': 0.39; 'subject:-': 0.40; 'header:Received:5': 0.40; 'your': 0.60; "you've": 0.61; 'watching': 0.65; '2013': 0.84; 'beforehand': 0.84; 'clearer': 0.84; 'target.': 0.84; 'migrating': 0.91; 'angel': 0.93; 'gaps': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ItPnqBar/9UllQxCznYDe+a6YCXO6CtBcyaryJ31+qs=; b=WirMXdinjgw6Cm0b5diAFLawDaJCX8XPItGFrtmBCNmRnjH8qQI7NumPHNvfUq4dLJ 4NlAJzxWgAMkmgnAopysx9015/N1Y56+d0ZgOJaZYPc0D8ZhZ6/s2YZqncKz6tnxqUn4 qrZVe25nWLOx/uVDXEAAd/xj4vK1NDCbHVD47tQjiy2WJmdcU0WCDvaO3Kpuc9b1eHl+ 6/yQ0f62LXg5upbIopm6M4YHY5f9i9D9A94lsVc9D2Yi9Dul8DqDcAb+H5QlR6C6x96u ikMBVT0BUqT7QJxDRmT8V2nDYl46pF1AFIWPqBYzevUGwjH+xjc5at4pH3RhEqPXMZH3 5Lzw== MIME-Version: 1.0 In-Reply-To: References: <1454e34f-5ca0-4f49-ad29-c99df4fdd322@gu9g2000vbb.googlegroups.com> Date: Mon, 14 Jan 2013 07:59:15 +1100 Subject: Re: pylint or similar to test version-specific language constructs? From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1358110759 news.xs4all.nl 6870 [2001:888:2000:d::a6]:35480 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:36753 On Mon, Jan 14, 2013 at 4:56 AM, jkn wrote: > Hi Dave > > On 11 Jan, 15:06, Dave Angel wrote: >> >> Not sure what you mean by beforehand. Don't you run all your unit tests >> before putting each revision of your code into production? So run those >> tests twice, once on 2.7, and once on 2.4. A unit test that's testing >> code with a ternary operator will fail, without any need for a separate >> test. >> >> if it doesn't, then you've got some coverage gaps in your unit tests. > > By 'beforehand' I meant 'before testing on my target 2.4 system; > perhaps I should have been clearer in that I am running 2.7 on my > 'development' platform, and 2.4 on my target. It would be painful to > put 2.4 on my target system (although I continue to wonder about > that...). So I was looking to catch such errors before migrating to > the target. Painful to put 2.4 on your dev, you mean? I've never done it, but I would expect that the old sources will compile against newer libraries with no problems. That's likely to be the easiest option. It's the language-level equivalent of watching for a thrown exception rather than asking forgiveness beforehand :) ChrisA