mirror of
https://github.com/python/cpython.git
synced 2025-11-02 19:12:55 +00:00
Add test_main() functions to various tests where it was simple to do. Done so
that regrtest can execute the test_main() directly instead of relying on import side-effects.
This commit is contained in:
parent
963c80fd45
commit
7dbd91811d
9 changed files with 63 additions and 36 deletions
|
|
@ -14,7 +14,7 @@ cdattrs = ['BLOCKSIZE', 'CDROM', 'DATASIZE', 'ERROR', 'NODISC', 'PAUSED', 'PLAYI
|
|||
# attributes. More comprehensive examples can be found in Demo/cd and
|
||||
# require that you have a CD and a CD ROM drive
|
||||
|
||||
def main():
|
||||
def test_main():
|
||||
# touch all the attributes of cd without doing anything
|
||||
if verbose:
|
||||
print 'Touching cd module attributes...'
|
||||
|
|
@ -23,4 +23,7 @@ def main():
|
|||
print 'touching: ', attr
|
||||
getattr(cd, attr)
|
||||
|
||||
main()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
test_main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue