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
5
5
import site
6
6
import sys
7
7
8
- # at least one module must be specified
9
- if len (sys .argv ) == 1 :
10
- print "No module specified."
11
-
12
8
# calculate the working directory
13
9
sdir = os .path .abspath (__file__ )
14
10
wd = os .path .dirname (os .path .dirname (sdir ))
15
11
site .addsitedir (wd )
16
12
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
+
17
21
# for each module
18
- for module_path in sys . argv [ 1 :] :
22
+ for module_path in modules :
19
23
print "Testing " + module_path
20
24
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
3
3
===============
4
4
5
5
.. toctree ::
6
- :hidden:
6
+ :hidden:
7
7
8
- api/modules
9
- installation
10
- changelog
8
+ installation
9
+ api/modules
10
+ changelog
11
+ development
11
12
12
13
Installation
13
14
============
@@ -133,6 +134,12 @@ Reply on a Message Thread
133
134
thread_id=123,
134
135
body="Not much either :(")
135
136
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
+
136
143
Changelog
137
144
=========
138
145
You can’t perform that action at this time.
0 commit comments