File tree Expand file tree Collapse file tree 7 files changed +63
-26
lines changed Expand file tree Collapse file tree 7 files changed +63
-26
lines changed Original file line number Diff line number Diff line change
1
+ sudo : false
2
+ language : python
3
+ python :
4
+ - ' 2.7'
5
+ install :
6
+ - pip install tox
7
+ env :
8
+ - TOX_ENV=py27-test
9
+ - TOX_ENV=py33-test
10
+ - TOX_ENV=py34-test
11
+ script :
12
+ - tox -e $TOX_ENV
13
+ deploy :
14
+ provider : pypi
15
+ user : mattbennett
16
+ password :
17
+ secure : nS/snIn4e/AWu3yrpzDLPXB+wHXXVU0qLdf07ldUxBx3lJ5K4ggqM1o6huP+ny2lZM6Q+jlRaYj0L6Tb/pppC7Pimx+dni9EFHXvLVO5sLD80+qV/AQPf7tbdWY6FWBV8kMGpXPwdnbKRGnQ17nerBJUfvL0dxigGoAqpOgwxppw/qNk0J3ay2AUnKUnWUKUXgATBLH72MSW6/iT84asIV6jOlfmRLpFKiO42emyBmYTo/TwM6lkjLG465gI2oWc/2sVTR6rkq00Yz5AC3Ry/pUZYfg55M3hTgHSQ54qtd/7IlbsP9inYTiZGsYkDaHlKsM1DdXreApVIo7LzRfCblMGrGvQfZm3BVMmmOWGSzM9dqBOXxjVcG9xHoG4/jzxGJ40gXX4cRS0AgkAWak2Q34QKj30FIBeLrZNzpDUmyPrKFBkfLi8CR8pW06m0Kxs3XWoUvP7ajVocbGnQHXQpz4q7FoKmnXhg0u9XyJTdtZAMt/h7aN9Bb2N0Zfasex025dB93Z2qLmwMVYkwQhIxjfw4vCstq9t+q67JKDMP4O6T7ektJ1Qt2TNR2BEr0/V/r5uplH5qyNH8PKL5YV9afyI+f1Dbdk+8wsRBGFJOm+rHg/JLtkzpTjNeAy4VYsYb8R+1rRe9IyBR7ti0mpW22lemhAHUUdaaol7mZm5yTI=
18
+ on :
19
+ tags : true
20
+ repo : Overseas-Student-Living/sqlalchemy-diff
Original file line number Diff line number Diff line change 1
1
.PHONY : test
2
2
3
- HTMLCOV_DIR ?= htmlcov
3
+ test : flake8 pylint pytest
4
4
5
- test : flake8 test_lib
5
+ pylint :
6
+ pylint sqlalchemydiff -E
6
7
7
8
flake8 :
8
9
flake8 sqlalchemydiff test
9
10
10
- test_lib :
11
- coverage run --source=sqlalchemydiff -m pytest test $(ARGS )
12
-
13
- coverage-html : test
14
- coverage html -d $(HTMLCOV_DIR )
15
-
16
- coverage-report : test
17
- coverage report -m
18
-
19
- coverage : coverage-html coverage-report test
11
+ pytest :
12
+ coverage run --source=sqlalchemydiff --branch -m pytest test $(ARGS )
13
+ coverage report --show-missing --fail-under=100
Original file line number Diff line number Diff line change @@ -7,26 +7,37 @@ SQLAlchemy Diff
7
7
inspection API.
8
8
9
9
10
+ Documentation
11
+ -------------
12
+
13
+ See `<http://sqlalchemy-diff.readthedocs.org >`_.
14
+
15
+
10
16
Running tests
11
17
-------------
12
18
13
- Makefile targets that can be used to run the tests .
19
+ Tests are written with pytest. Makefile targets to invoke tests are also provided for convenience .
14
20
15
21
Test databases will be created, used during the tests and destroyed afterwards.
16
22
17
- Example of usage :
23
+ Example:
18
24
19
25
.. code-block :: shell
20
26
21
27
$ # using default settings
22
- $ pytest test
23
28
$ make test
24
- $ make coverage
25
29
26
- $ # or overridding the database URI
27
- $ pytest test --test-db-url=mysql+mysqlconnector://root:password@localhost:3306/sqlalchemydiff
30
+ # or
31
+ $ py.test test
32
+
33
+ $ # overridding the database URI
34
+ $ py.test test --test-db-url=mysql+mysqlconnector://root:password@localhost:3306/sqlalchemydiff
35
+
36
+ # or
28
37
$ make test ARGS=" --test-db-url=mysql+mysqlconnector://root:password@localhost:3306/sqlalchemydiff"
29
- $ make coverage ARGS=" --lf -x -vv --test-db-url=mysql+mysqlconnector://root:password@localhost:3306/sqlalchemydiff"
38
+
39
+ # providing other pytest args via Make
40
+ $ make test ARGS=" --lf -x -vv"
30
41
31
42
32
43
License
Original file line number Diff line number Diff line change 24
24
"six>=1.10.0" ,
25
25
"sqlalchemy-utils>=0.32.4" ,
26
26
],
27
+ dependency_links = [
28
+ 'https://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-2.1.4.zip'
29
+ ],
27
30
extras_require = {
28
31
'dev' : [
29
32
"mock==2.0.0" ,
30
- "mysql-connector-python==2.0 .4" ,
33
+ "mysql-connector-python==2.1 .4" ,
31
34
"pytest==3.0.3" ,
35
+ "pylint==1.5.1" ,
32
36
"flake8==3.0.4" ,
33
37
"coverage==4.2" ,
34
38
],
Original file line number Diff line number Diff line change @@ -12,12 +12,12 @@ def pytest_addoption(parser):
12
12
action = 'store' ,
13
13
dest = 'TEST_DB_URL' ,
14
14
default = (
15
- 'mysql+mysqlconnector://root:password @localhost:3306/'
15
+ 'mysql+mysqlconnector://root:@localhost:3306/'
16
16
'sqlalchemydiff'
17
17
),
18
18
help = (
19
19
'DB url for testing (e.g. '
20
- '"mysql+mysqlconnector://root:password @localhost:3306/'
20
+ '"mysql+mysqlconnector://root:@localhost:3306/'
21
21
'sqlalchemydiff' '")'
22
22
)
23
23
)
Original file line number Diff line number Diff line change @@ -52,6 +52,13 @@ def test_dump_errors(self):
52
52
53
53
os .unlink (filename )
54
54
55
+ def test_dump_with_null_filename (self ):
56
+ errors = {'some' : 'errors' }
57
+ result = CompareResult ({}, errors )
58
+
59
+ expected_dump = json .dumps (errors , indent = 4 , sort_keys = True )
60
+ assert result .dump_errors (filename = None ) == expected_dump
61
+
55
62
56
63
class TestInspectorFactory (object ):
57
64
Original file line number Diff line number Diff line change 1
1
[tox]
2
- envlist = py27,py33,py34
2
+ envlist = { py27,py33,py34}-test
3
3
skipdist =True
4
- skip_missing_interpreters =True
5
4
6
5
[testenv]
6
+ whitelist_externals = make
7
+
7
8
commands =
8
- pip install -e " .[dev]" --process-dependency-links
9
- py. test
9
+ pip install --editable .[dev] --process-dependency-links
10
+ make test
You can’t perform that action at this time.
0 commit comments