Skip to content

Instantly share code, notes, and snippets.

View pfctdayelise's full-sized avatar

Brianna Laugher pfctdayelise

View GitHub Profile
% Generate/verify memes in Prolog.
noun(apple).
noun(banana).
noun(orange).
noun(kiwifruit).
irregular_noun(kiwifruit, kiwifruit).
@pfctdayelise
pfctdayelise / issue4806.py
Created February 19, 2014 04:09
Demonstration and workaround of Python bug 4806
# 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
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'])