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 os | |
import argparse | |
import urllib | |
from BeautifulSoup import BeautifulSoup # 3.2.0 | |
def getPagesForOnePath(path): | |
f = urllib.urlopen(path) | |
soup = BeautifulSoup(f) |
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
import pytest | |
def params(n): | |
fn = range(n) | |
return {'name': 'a', 'args': fn, 'ids': ['a: {}'.format(i) for i in fn]} | |
named_args = params(3) | |
@pytest.mark.parametrize( | |
named_args['name'], named_args['args'], ids=named_args['ids']) |
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
# written in python2.7 | |
def bad(n): | |
if n == 1: | |
raise ValueError('n is 1!') | |
if n == 2: | |
raise TypeError('n is 2!') | |
return n, 2*n |
NewerOlder