Skip to content

Instantly share code, notes, and snippets.

@christian-blades-cb
Last active December 2, 2016 00:39
Show Gist options
  • Save christian-blades-cb/636c08b32447b22a9b5974fe9165e18a to your computer and use it in GitHub Desktop.
Save christian-blades-cb/636c08b32447b22a9b5974fe9165e18a to your computer and use it in GitHub Desktop.
FROM python:2.7-alpine
RUN pip install tox
ADD . /src
WORKDIR /src
CMD tox
from hypothesis import given
import hypothesis.strategies as st
ASCII_NO_WHITESPACE_TABS_NEWLINES = st.characters(min_codepoint=1, max_codepoint=128, blacklist_categories=('Cc', 'Zs', 'Po'))
BUCKET_NAMES = st.text(min_size=1, max_size=1024, alphabet=ASCII_NO_WHITESPACE_TABS_NEWLINES)
@given(BUCKET_NAMES, st.integers())
def test_incr(bucket, delta):
with assert_statsd_received(BINDING, bucket, str(delta), "c", None):
client = statsd.StatsDEmitter(*BINDING)
client.incr(bucket, delta)
[tox]
envlist = py27
downloadcache = {toxworkdir}/_download/
[testenv]
deps =
pytest
mock
pytest-cov
hypothesis
sitepackages = False
commands =
py.test -v --cov=statsd --cov-report=term-missing test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment