Re: PEP 299 and unit testing

2007-10-28 Thread Ben Finney
Ben Finney <[EMAIL PROTECTED]> writes: > Steven Bethard <[EMAIL PROTECTED]> writes: > > > Ben Finney wrote: > > > What it doesn't allow is for the testing of the 'if __name__ == > > > "__main__":' clause itself. No matter how simple we make that, > > > it's still functional code that can contain

Re: PEP 299 and unit testing

2007-10-28 Thread Ben Finney
Steven Bethard <[EMAIL PROTECTED]> writes: > Ben Finney wrote: > > Thanks! I was unaware of that module. It does seem to nicely > > address the issue I discussed. > > You might try the runpy module as-is with Python 2.4. I don't know > if it works, but it's pure Python so it's worth a try. Drat

Re: PEP 299 and unit testing

2007-10-28 Thread Steven Bethard
Ben Finney wrote: > Steven Bethard <[EMAIL PROTECTED]> writes: > >> Ben Finney wrote: >>> What it doesn't allow is for the testing of the 'if __name__ == >>> "__main__":' clause itself. No matter how simple we make that, >>> it's still functional code that can contain errors, be they >>> obvious o

Re: PEP 299 and unit testing

2007-10-28 Thread Ben Finney
Steven Bethard <[EMAIL PROTECTED]> writes: > Ben Finney wrote: > > What it doesn't allow is for the testing of the 'if __name__ == > > "__main__":' clause itself. No matter how simple we make that, > > it's still functional code that can contain errors, be they > > obvious or subtle; yet it's code

Re: PEP 299 and unit testing

2007-10-28 Thread Steven Bethard
Ben Finney wrote: > What it doesn't allow is for the testing of the 'if __name__ == > "__main__":' clause itself. No matter how simple we make that, it's > still functional code that can contain errors, be they obvious or > subtle; yet it's code that *can't* be touched by the unit test (by > design

PEP 299 and unit testing

2007-10-28 Thread Ben Finney
Howdy all, PEP 299 http://www.python.org/dev/peps/pep-0299> details an enhancement for entry points to Python programs: a module attribute (named '__main__') that will be automatically called if the module is run as a program. The PEP has status "Rejected", citing backward-compatibility issues, a