Skip to content

Commit 000180b

Browse files
author
Robert Buck
committed
Add contributing file to detail how to build the project, run coverage tools, etc. Cleanup misc. Add coverage reporting for both HTML output and CLI output. This is ready to have Coveralls run analysis online with detailed online reporting.
1 parent 4f6bdf6 commit 000180b

File tree

6 files changed

+81
-5
lines changed

6 files changed

+81
-5
lines changed

.coveragerc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[run]
2-
include=sqlalchemy_nuodb/*
2+
include=pynuodb/*
33

44
[report]
5-
omit=test/*
5+
omit=tests/*

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ pip-log.txt
2525
.coverage
2626
.tox
2727
nosetests.xml
28+
htmlcov/
2829

2930
# Translations
3031
*.mo

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ install:
2727

2828
script:
2929
- make all
30+
- py.test --cov=pynuodb --cov-report term-missing
3031

3132
after_failure:
3233
- cat /var/log/nuodb/agent.log

CONTRIBUTING.rst

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
Development
2+
-----------
3+
4+
The following sections are intended for developers.
5+
6+
Requirements
7+
~~~~~~~~~~~~
8+
9+
Developers should use virtualenv to maintain multiple side-by-side
10+
environments to test with. Specifically, all contributions must be
11+
tested with both 2.7.6 and 3.4.3 to ensure the library is syntax
12+
compatible between the two versions.
13+
14+
Dependencies
15+
~~~~~~~~~~~~
16+
17+
Here was my basic setup on Mac OS X:
18+
19+
| virtualenv --python=/usr/bin/python2.7 ~/.venv/pynuodb
20+
| source ~/.venv/pynuodb/bin/activate
21+
| pip install mock
22+
| pip install nose
23+
| pip install pytest
24+
| pip install coverage
25+
26+
There are some commonly used libraries with this:
27+
28+
| pip install sqlalchemy
29+
| pip install sqlalchemy-nuodb
30+
31+
Or simply:
32+
33+
| pip install -r requirements.txt
34+
35+
Then once those are setup...
36+
37+
Developer Testing
38+
~~~~~~~~~~~~~~~~~
39+
40+
My basic means of testing has been:
41+
42+
| source ~/.venv/pynuodb/bin/activate
43+
| cd <project directory>
44+
| py.test
45+
46+
First and foremost, painful py.test less, it captures STDOUT and will not
47+
display your log messages. To disable this behavior and enable sane logging
48+
the following option is suggested:
49+
50+
| --capture=no
51+
52+
To stop on first failure you could augment that with the pdb option:
53+
54+
| py.test --pdb
55+
56+
To run a specific test you could do something like this:
57+
58+
| py.test -k "SomeTest and test_something"
59+
60+
Or any combination of the above, if you like.
61+
62+
To gather coverage information you can run the following command:
63+
64+
| py.test --cov=pynuodb --cov-report html --cov-report term-missing
65+
66+
Developer Installation
67+
~~~~~~~~~~~~~~~~~~~~~~
68+
69+
With pip installed, you can install this project via:
70+
71+
| pip install -e .
72+
73+
Release
74+
-------
75+
76+
Maintain the list of changes per release in CHANGES.rst. Also note the known defects.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ install:
3636

3737
test:
3838
pip install -r test_requirements.txt
39-
py.test tests
39+
py.test --cov=pynuodb --cov-report html --cov-report term-missing
4040

4141
deploy:
4242
python setup.py register

tests/nuodb_cursor_test.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ def test_cursor_rowcount_select(self):
3333
def test_insufficient_parameters(self):
3434
con = self._connect()
3535
cursor = con.cursor()
36-
# cursor.execute("SELECT ? FROM DUAL")
37-
# cursor.execute("SELECT ? FROM DUAL", [0])
3836

3937
try:
4038
cursor.execute("SELECT ?, ? FROM DUAL", [1])

0 commit comments

Comments
 (0)