Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'travisci'

  • Loading branch information...
commit 34fe8a4795f18b1a441bbb9a5a207898ba60397e 2 parents 24ceb3b + c3ca8ee
@earl authored
View
6 .nose.cfg
@@ -0,0 +1,6 @@
+[nosetests]
+verbosity=3
+
+with-doctest=1
+doctest-extension=mkd
+doctest-fixtures=_fixtures
View
1  .travis-requirements.txt
@@ -0,0 +1 @@
+pyyaml
View
13 .travis.yml
@@ -0,0 +1,13 @@
+language: python
+python:
+ - "2.6"
+ - "2.7"
+
+install:
+ - sudo apt-get install beanstalkd
+ - pip install -r .travis-requirements.txt --use-mirrors
+script: nosetests -c .nose.cfg
+
+branches:
+ only:
+ - master
View
2  README.mkd
@@ -21,7 +21,7 @@ Usage
Here is a short example, to illustrate the flavor of beanstalkc:
>>> import beanstalkc
- >>> beanstalk = beanstalkc.Connection(host='localhost', port=11300)
+ >>> beanstalk = beanstalkc.Connection(host='localhost', port=14711)
>>> beanstalk.put('hey!')
1
>>> job = beanstalk.reserve()
View
1  README_fixtures.py
@@ -0,0 +1 @@
+from test.fixtures import setup, teardown
View
1  TUTORIAL_fixtures.py
@@ -0,0 +1 @@
+from test.fixtures import setup, teardown
View
11 beanstalkc.py
@@ -284,12 +284,5 @@ def stats(self):
if __name__ == '__main__':
- import doctest, os, signal
- try:
- pid = os.spawnlp(os.P_NOWAIT,
- 'beanstalkd',
- 'beanstalkd', '-l', '127.0.0.1', '-p', '14711')
- doctest.testfile('TUTORIAL.mkd')
- doctest.testfile('test/no-yaml.doctest')
- finally:
- os.kill(pid, signal.SIGTERM)
+ import nose
+ nose.main(argv=['nosetests', '-c', '.nose.cfg'])
View
0  test/__init__.py
No changes.
View
13 test/fixtures.py
@@ -0,0 +1,13 @@
+import os, signal, time
+
+_BEANSTALKD_PID = None
+
+def setup(module):
+ module._BEANSTALKD_PID = os.spawnlp(
+ os.P_NOWAIT,
+ 'beanstalkd',
+ 'beanstalkd', '-l', '127.0.0.1', '-p', '14711')
+ time.sleep(0.5) # Give beanstalkd some time to ready.
+
+def teardown(module):
+ os.kill(module._BEANSTALKD_PID, signal.SIGTERM)
View
0  test/no-yaml.doctest → test/no-yaml.mkd
File renamed without changes
View
1  test/no-yaml_fixtures.py
@@ -0,0 +1 @@
+from fixtures import setup, teardown
Please sign in to comment.
Something went wrong with that request. Please try again.