Skip to content

Instantly share code, notes, and snippets.

View Fluxx's full-sized avatar

Jeff Pollard Fluxx

View GitHub Profile
import time
from contextlib import contextmanager
from decimal import Decimal
ITERATIONS = 500000
TRIALS = 10
makedecimal_lambda = lambda v: Decimal(str(v))
def makedecimal_func(v):
from contextlib import contextmanager
from models import User
@contextmanager
def maybe(thing, check=lambda thing: thing):
if check(thing):
yield thing
diff --git a/disqus/application.py b/disqus/application.py
index 6674d30..297dc7f 100644
--- a/disqus/application.py
+++ b/disqus/application.py
@@ -8,7 +8,6 @@ If you're writing a new script, ensure it gets fired either via
manage.py, runs via a wsgi file which inherits wsgi/default.py,
or imports cli if its a script (in scripts/).
"""
-import functools
import os
Jinja2==2.6
PyYAML==3.10
Pygments==1.5
Sphinx==1.1.3
argh==0.15.1
argparse==1.2.1
blessings==1.3
chattr.io==0.8.11
chattr.specs==0.17.0
clint==0.3.1
@attr('requires-zookeeper')
class TestKafkaTpoicIntegration(BaseIntegrationTest, KafkaIntegrationTestCase):
@fixture
def zookeeper(self):
client = KazooClient()
client.connect()
return client
@fixture
(Pdb) list(self.partitions)
*** Error in argument: '(self.partitions)'
(Pdb) self.partitions
<samsa.partitions.PartitionMap at 0x108cee650: topic=<samsa.topics.Topic at 0x108cee610: name='tests.integration'>>
======================================================================
ERROR: test_service_additions_work (tests.chattr.test_integration.TestKafkaTpoicIntegration)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/jeff/Code/chattr.io/client/tests/chattr/test_integration.py", line 53, in test_service_additions_work
returned = self.send_receive(self.valid_message)
File "/Users/jeff/Code/chattr.io/client/tests/chattr/test_integration.py", line 40, in send_receive
self.channel.send(message)
File "/Users/jeff/Code/chattr.io/client/src/chattr/io/models.py", line 90, in send
return self.__delegate('send', self.translator.encode(prepped), block)
======================================================================
ERROR: test_service_additions_work (tests.chattr.test_integration.TestKafkaTpoicIntegration)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/jeff/Code/samsa/samsa/test/integration.py", line 300, in setUp
super(KafkaIntegrationTestCase, self).setUp()
File "/Users/jeff/Code/samsa/samsa/test/integration.py", line 266, in setUp
self.setup_zookeeper()
File "/Users/jeff/.virtualenvs/chattr.io/lib/python2.6/site-packages/kazoo/testing/__init__.py", line 233, in setup_zookeeper
if not self.cluster[0].running:
➜ ~ cd /Users/jeff/.virtualenvs/chattr.io/lib/python2.6/site-packages/samsa/
➜ samsa ll
total 240
-rw-r--r-- 1 jeff staff 579 Jul 31 10:41 __init__.py
-rw-r--r-- 1 jeff staff 773 Jul 31 10:42 __init__.pyc
-rw-r--r-- 1 jeff staff 5434 Jul 31 10:41 brokers.py
-rw-r--r-- 1 jeff staff 7222 Jul 31 10:42 brokers.pyc
-rw-r--r-- 1 jeff staff 9463 Jul 31 10:41 client.py
-rw-r--r-- 1 jeff staff 11039 Jul 31 10:42 client.pyc
-rw-r--r-- 1 jeff staff 1074 Jul 31 10:41 cluster.py
(chattr.io)➜ client git:(master) python
Python 2.6.7 (r267:88850, Jul 31 2011, 19:30:54)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from kazoo.client import KazooClient
>>> from samsa.cluster import Cluster
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/jeff/.virtualenvs/chattr.io/lib/python2.6/site-packages/samsa/cluster.py", line 17, in <module>
from samsa.brokers import BrokerMap