Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,37 @@ fire up the command line, recreate the scenario and run queries:

.. image:: http://i442.photobucket.com/albums/qq150/gregmalcolm/DebuggingPython.png

Sniffer Support
---------------

Sniffer allows you to run the tests continuously. If you modify any files files
in the koans directory, it will rerun the tests.

To set this up, you need to install sniffer::

$ pip install sniffer

You should also run one of these libraries depending on your system. This will
automatically trigger sniffer when a file changes, otherwise sniffer will have
to poll to see if the files have changed.

On Linux::

$ pip install pyinotify

On Windows::

$ pip install pywin32

On Mac OS X::

$ pip install MacFSEvents

Once it is set up, you just run::

$ sniffer

Just modify one of the koans files and you'll see that the tests are triggered automatically. Sniffer is controlled by `scent.py`

Getting the Most From the Koans
-------------------------------
Expand Down
12 changes: 12 additions & 0 deletions python2/scent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from sniffer.api import *
import os

watch_paths = ['.', 'koans/']

@file_validator
def py_files(filename):
return filename.endswith('.py') and not os.path.basename(filename).startswith('.')

@runnable
def execute_koans(*args):
os.system('python -B contemplate_koans.py')
12 changes: 12 additions & 0 deletions python3/scent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from sniffer.api import *
import os

watch_paths = ['.', 'koans/']

@file_validator
def py_files(filename):
return filename.endswith('.py') and not os.path.basename(filename).startswith('.')

@runnable
def execute_koans(*args):
os.system('python3 -B contemplate_koans.py')