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
% Generate/verify memes in Prolog. | |
noun(apple). | |
noun(banana). | |
noun(orange). | |
noun(kiwifruit). | |
irregular_noun(kiwifruit, kiwifruit). |
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 |
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']) |
OlderNewer