File tree Expand file tree Collapse file tree 3 files changed +93
-9
lines changed
Expand file tree Collapse file tree 3 files changed +93
-9
lines changed Original file line number Diff line number Diff line change @@ -5,16 +5,20 @@ import os
55import site
66import sys
77
8- # at least one module must be specified
9- if len (sys .argv ) == 1 :
10- print "No module specified."
11-
128# calculate the working directory
139sdir = os .path .abspath (__file__ )
1410wd = os .path .dirname (os .path .dirname (sdir ))
1511site .addsitedir (wd )
1612
13+ # at least one module must be specified
14+ if len (sys .argv ) == 1 :
15+ glob_pattern = os .path .join (wd , 'intercom' , '*.py' )
16+ import glob
17+ modules = glob .glob (glob_pattern )
18+ else :
19+ modules = sys .argv [1 :]
20+
1721# for each module
18- for module_path in sys . argv [ 1 :] :
22+ for module_path in modules :
1923 print "Testing " + module_path
2024 doctest .testfile (module_path , module_relative = False )
Original file line number Diff line number Diff line change 1+ Development
2+ ===========
3+
4+ Running the tests
5+ -----------------
6+
7+ Run all of the (nose) tests:
8+
9+ ::
10+
11+ nosetests --with-coverage --cover-package=intercom tests
12+
13+ Run the unit tests:
14+
15+ ::
16+
17+ nosetests tests -e integration
18+
19+ Run the integration tests (using the dummy `app_id ` and `api_key `):
20+
21+ ::
22+
23+ nosetests tests -e unit
24+
25+ Doctests
26+ --------
27+
28+ Run all of the doctests:
29+
30+ ::
31+
32+ ./bin/doctest
33+
34+ Run the doctests in a specific module:
35+
36+ ::
37+
38+ ./bin/doctest intercom/user.py
39+
40+ Code coverage
41+ -------------
42+
43+ Generate a code coverage report:
44+
45+ ::
46+
47+ nosetests --with-coverage --cover-package=intercom tests
48+ Name Stmts Miss Cover Missing
49+ -------------------------------------------------------
50+ intercom 21 0 100%
51+ intercom.impression 25 0 100%
52+ intercom.intercom 85 0 100%
53+ intercom.message_thread 64 0 100%
54+ intercom.user 125 0 100%
55+ -------------------------------------------------------
56+ TOTAL 320 0 100%
57+ -------------------------------------------------------
58+
59+ Pylint
60+ ------
61+
62+ Generate a pylint report for a specific module:
63+
64+ ::
65+
66+ pylint --rcfile=pylint.conf intercom/user.py
67+
68+ Generate a full pylint report:
69+
70+ ::
71+
72+ pylint --rcfile=pylint.conf intercom
73+
Original file line number Diff line number Diff line change @@ -3,11 +3,12 @@ python-intercom
33===============
44
55.. toctree ::
6- :hidden:
6+ :hidden:
77
8- api/modules
9- installation
10- changelog
8+ installation
9+ api/modules
10+ changelog
11+ development
1112
1213Installation
1314============
@@ -133,6 +134,12 @@ Reply on a Message Thread
133134 thread_id=123,
134135 body="Not much either :(")
135136
137+ Development
138+ ===========
139+
140+ Our :doc: `development ` page has detailed instructions on how to run our
141+ tests, and to produce coverage and pylint reports.
142+
136143Changelog
137144=========
138145
You can’t perform that action at this time.
0 commit comments