Skip to content

Instantly share code, notes, and snippets.

@t2b
t2b / test_example.py
Created August 25, 2017 12:41
pytest skip test until date
from datetime import date
import pytest
@pytest.mark.skipif(date.today() < date(2017, 10, 1), reason='not yet implemented')
def test_foobar():
assert False
@brondsem
brondsem / gist:3278423
Created August 6, 2012 21:01
Both a Decorator and a Context Manager
class skip_if_exception(object):
'''
Given an exception type, returns a decorator & context manager
that will raise SkipTest if that exception type is raised
'''
def __init__(self, ExcType):
self.ExcType = ExcType
def __call__(self, func):
return decorator(self.try_func, func)
@henrik
henrik / eu_country_codes.rb
Last active December 20, 2023 12:20
EU (European Union) country codes, ISO 3166-1 alpha-2. (This Gist is from 2012. Please see comments for updates.)
# Note: VAT identification numbers for Greece use "EL", not "GR".
COUNTRY_CODES_EU = %w[
AT BE BG CY CZ DK EE FI FR DE GR HU IE IT
LV LT LU MT NL PL PT RO SK SI ES SE GB
]