This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def with_setup_args(setup, teardown=None): | |
"""Decorator to add setup and/or teardown methods to a test function:: | |
@with_setup_args(setup, teardown) | |
def test_something(): | |
" ... " | |
The setup function should return (args, kwargs) which will be passed to | |
test function, and teardown function. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import argparse | |
import sys | |
import collections | |
parser = argparse.ArgumentParser(description='Show the first 10, and last 10 lines of a file.') | |
parser.add_argument('infile', nargs='?', default=sys.stdin, | |
help='Input file. Defauts to stdin if not provided.') | |
parser.add_argument('outfile', nargs='?', default=sys.stdout, |