Skip to content

Commit 9b36d83

Browse files
author
Alexander Karev
committed
merge master conflict resolve
2 parents 7bd70f0 + 087ea54 commit 9b36d83

32 files changed

+1688
-246
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ _build
1313
/bin/
1414
/include/
1515
/lib/
16+
/src/
1617
.cache

.travis.yml

Lines changed: 17 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -1,123 +1,22 @@
1-
language: python
21

2+
language: python
33
python:
4-
- "2.6"
5-
- "2.7"
6-
- "3.2"
74
- "3.3"
8-
- "pypy"
9-
10-
# Django 1.3 is only compatible with psycopg2 version <= 2.4.1
11-
# Django 1.4 is compatible with newer versions
125
env:
13-
- DB=sqlite DJANGO_VERSION=1.3.5 PSYCOPG_VERSION=2.4.1
14-
- DB=sqlite DJANGO_VERSION=1.4.3 PSYCOPG_VERSION=2.4.5
15-
- DB=sqlite DJANGO_VERSION=1.5.2 PSYCOPG_VERSION=2.4.5
16-
- DB=sqlite DJANGO_VERSION=1.6.1 PSYCOPG_VERSION=2.4.5
17-
- DB=sqlite DJANGO_VERSION=master PSYCOPG_VERSION=2.4.5
18-
19-
- DB=mysql DJANGO_VERSION=1.3.5 PSYCOPG_VERSION=2.4.1
20-
- DB=mysql DJANGO_VERSION=1.4.3 PSYCOPG_VERSION=2.4.5
21-
- DB=mysql DJANGO_VERSION=1.5.2 PSYCOPG_VERSION=2.4.5
22-
- DB=mysql DJANGO_VERSION=1.6.1 PSYCOPG_VERSION=2.4.5
23-
- DB=mysql DJANGO_VERSION=master PSYCOPG_VERSION=2.4.5
24-
25-
- DB=postgres DJANGO_VERSION=1.3.5 PSYCOPG_VERSION=2.4.1
26-
- DB=postgres DJANGO_VERSION=1.4.3 PSYCOPG_VERSION=2.4.5
27-
- DB=postgres DJANGO_VERSION=1.5.2 PSYCOPG_VERSION=2.4.5
28-
- DB=postgres DJANGO_VERSION=1.6.1 PSYCOPG_VERSION=2.4.5
29-
- DB=postgres DJANGO_VERSION=master PSYCOPG_VERSION=2.4.5
30-
31-
32-
6+
- TESTENV=pypy-master-sqlite
7+
- TESTENV=python2.6-1.6-sqlite
8+
- TESTENV=python2.7-1.3-sqlite
9+
- TESTENV=python2.7-1.4-sqlite
10+
- TESTENV=python2.7-master-mysql_innodb
11+
- TESTENV=python2.7-master-mysql_myisam
12+
- TESTENV=python2.7-master-sqlite
13+
- TESTENV=python3.2-master-sqlite
14+
- TESTENV=python3.3-master-sqlite
15+
- TESTENV=python3.4-1.5-sqlite
16+
- TESTENV=python3.4-1.6-sqlite
17+
- TESTENV=python3.4-1.7-sqlite
18+
- TESTENV=python3.4-master-postgres
19+
- TESTENV=python3.4-master-sqlite
3320
install:
34-
- pip install pytest
35-
- pip install django-configurations>=0.2.1
36-
- 'if [ "$DJANGO_VERSION" != "master" ]; then pip install django==$DJANGO_VERSION; fi'
37-
- 'if [ "$DJANGO_VERSION" == "master" ]; then pip install -e git+https://github.com/django/django@master#egg=Django; fi'
38-
- 'if [ "$TRAVIS_PYTHON_VERSION" == "pypy" -a "$DB" == postgres ]; then pip install psycopg2ct; fi'
39-
- 'if [ "$TRAVIS_PYTHON_VERSION" != "pypy" -a "$DB" == postgres ]; then pip install psycopg2==$PSYCOPG_VERSION; fi'
40-
- 'if [ "$DB" == mysql ]; then pip install mysql-python; fi'
41-
- pip install -r requirements.txt
42-
43-
before_script:
44-
- psql -c 'create database pytest_django;' -U postgres
45-
- psql -c 'create database pytest_django_reuse;' -U postgres
46-
47-
- mysql -e 'create database pytest_django;'
48-
- mysql -e 'create database pytest_django_reuse;'
49-
50-
script: py.test --ds=tests.settings_$DB
51-
52-
53-
matrix:
54-
exclude:
55-
# pypy + postgres
56-
- python: pypy
57-
env: DB=postgres DJANGO_VERSION=1.3.5 PSYCOPG_VERSION=2.4.1
58-
- python: pypy
59-
env: DB=postgres DJANGO_VERSION=1.4.3 PSYCOPG_VERSION=2.4.5
60-
- python: pypy
61-
env: DB=postgres DJANGO_VERSION=1.5.2 PSYCOPG_VERSION=2.4.5
62-
- python: pypy
63-
env: DB=postgres DJANGO_VERSION=1.6.1 PSYCOPG_VERSION=2.4.5
64-
# pypy + mysql
65-
- python: pypy
66-
env: DB=mysql DJANGO_VERSION=1.3.5 PSYCOPG_VERSION=2.4.1
67-
- python: pypy
68-
env: DB=mysql DJANGO_VERSION=1.4.3 PSYCOPG_VERSION=2.4.5
69-
- python: pypy
70-
env: DB=mysql DJANGO_VERSION=1.5.2 PSYCOPG_VERSION=2.4.5
71-
# python 3.2 + django 1.3
72-
- python: "3.2"
73-
env: DB=sqlite DJANGO_VERSION=1.3.5 PSYCOPG_VERSION=2.4.1
74-
- python: "3.2"
75-
env: DB=mysql DJANGO_VERSION=1.3.5 PSYCOPG_VERSION=2.4.1
76-
- python: "3.2"
77-
env: DB=postgres DJANGO_VERSION=1.3.5 PSYCOPG_VERSION=2.4.1
78-
# python 3.2 + django 1.4
79-
- python: "3.2"
80-
env: DB=sqlite DJANGO_VERSION=1.4.3 PSYCOPG_VERSION=2.4.5
81-
- python: "3.2"
82-
env: DB=mysql DJANGO_VERSION=1.4.3 PSYCOPG_VERSION=2.4.5
83-
- python: "3.2"
84-
env: DB=postgres DJANGO_VERSION=1.4.3 PSYCOPG_VERSION=2.4.5
85-
# python 3.2 + mysql
86-
- python: "3.2"
87-
env: DB=mysql DJANGO_VERSION=1.5.2 PSYCOPG_VERSION=2.4.5
88-
- python: "3.2"
89-
env: DB=mysql DJANGO_VERSION=1.6.1 PSYCOPG_VERSION=2.4.5
90-
- python: "3.2"
91-
env: DB=mysql DJANGO_VERSION=master PSYCOPG_VERSION=2.4.5
92-
93-
# python 3.3 + django 1.3
94-
- python: "3.3"
95-
env: DB=sqlite DJANGO_VERSION=1.3.5 PSYCOPG_VERSION=2.4.1
96-
- python: "3.3"
97-
env: DB=mysql DJANGO_VERSION=1.3.5 PSYCOPG_VERSION=2.4.1
98-
- python: "3.3"
99-
env: DB=postgres DJANGO_VERSION=1.3.5 PSYCOPG_VERSION=2.4.1
100-
# python 3.3 + django 1.4
101-
- python: "3.3"
102-
env: DB=sqlite DJANGO_VERSION=1.4.3 PSYCOPG_VERSION=2.4.5
103-
- python: "3.3"
104-
env: DB=mysql DJANGO_VERSION=1.4.3 PSYCOPG_VERSION=2.4.5
105-
- python: "3.3"
106-
env: DB=postgres DJANGO_VERSION=1.4.3 PSYCOPG_VERSION=2.4.5
107-
# python 3.3 + mysql
108-
- python: "3.3"
109-
env: DB=mysql DJANGO_VERSION=1.5.2 PSYCOPG_VERSION=2.4.5
110-
- python: "3.3"
111-
env: DB=mysql DJANGO_VERSION=1.6.1 PSYCOPG_VERSION=2.4.5
112-
- python: "3.3"
113-
env: DB=mysql DJANGO_VERSION=master PSYCOPG_VERSION=2.4.5
114-
115-
# Django 1.7 and Python 2.6
116-
- python: "2.6"
117-
env: DB=sqlite DJANGO_VERSION=master PSYCOPG_VERSION=2.4.5
118-
119-
- python: "2.6"
120-
env: DB=mysql DJANGO_VERSION=master PSYCOPG_VERSION=2.4.5
121-
122-
- python: "2.6"
123-
env: DB=postgres DJANGO_VERSION=master PSYCOPG_VERSION=2.4.5
21+
- pip install tox
22+
script: tox -e $TESTENV

Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
.PHONY: docs test clean
22

3-
bin/python:
3+
testenv: bin/py.test
4+
5+
6+
bin/python bin/pip:
47
virtualenv .
58

6-
bin/py.test: bin/python
9+
bin/py.test: bin/python requirements.txt
710
bin/pip install -Ur requirements.txt
11+
touch $@
812

913
test: bin/py.test
10-
bin/pip install -Ur requirements.txt
14+
bin/pip install -e .
1115
bin/py.test
1216

13-
bin/sphinx-build:
17+
bin/sphinx-build: bin/pip
1418
bin/pip install sphinx
1519

1620
docs: bin/sphinx-build

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pytest-django is a plugin for `pytest <http://pytest.org/>`_ that provides a set
66

77
* Authors: Ben Firshman, Andreas Pelme and `contributors <https://github.com/pelme/pytest_django/contributors>`_
88
* Licence: BSD
9-
* Compatibility: Django 1.3-1.6 (experimental support for 1.7), python 2.5-2.7, 3.2-3.3 or PyPy, pytest >= 2.3.4
9+
* Compatibility: Django 1.3-1.7 (Django master is compatible at the time of each release), python 2.5-2.7, 3.2-3.3 or PyPy, pytest >= 2.3.4
1010
* Project URL: https://github.com/pelme/pytest_django
1111
* Documentation: http://pytest-django.rtfd.org/
1212

docs/changelog.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
Changelog
22
=========
3+
4+
2.6.2
5+
-----
6+
7+
* Fixed a bug that caused doctests to runs. Thanks to @jjmurre for the patch
8+
9+
* Fixed issue #88 - make sure to use SQLite in memory database when running
10+
with pytest-xdist.
11+
12+
2.6.1
13+
-----
14+
This is a bugfix/support release with no new features:
15+
16+
* Added support for Django 1.7 beta and Django master as of 2014-04-16.
17+
pytest-django is now automatically tested against the latest git master
18+
version of Django.
19+
20+
* Support for MySQL with MyISAM tables. Thanks to Zach Kanzler and Julen Ruiz
21+
Aizpuru for fixing this. This fixes issue #8 #64.
22+
323
2.6.0
424
-----
525
* Experimental support for Django 1.7 / Django master as of 2014-01-19.
@@ -8,6 +28,12 @@ Changelog
828
Django. The support is experimental since Django 1.7 is not yet released, but
929
the goal is to always be up to date with the latest Django master
1030

31+
2.5.1
32+
-----
33+
Invalid release accidentally pushed to PyPI (identical to 2.6.1). Should not be
34+
used - use 2.6.1 or newer to avoid confusion.
35+
36+
1137
2.5.0
1238
-----
1339
* Python 2.5 compatibility dropped. py.test 2.5 dropped support for Python 2.5,

docs/contributing.rst

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Community
1313
*********
1414

1515
The fastest way to get feedback on contributions/bugs are usually to open an
16-
issue in the `issue tracker`_.
16+
issue in the `issue tracker`_.
1717

1818
Discussions also happends via IRC in #pylib on irc.freenode.org. You may also
1919
be interested in following `@andreaspelme`_ on Twitter.
@@ -108,8 +108,41 @@ something this way) or IRC discussions.
108108
Running the tests
109109
-----------------
110110

111-
To run the tests simply execute ``py.test`` from your shell. Make sure you have
112-
Django and py.test installed before running the tests.
111+
There is a Makefile in the repository which aids in setting up a virtualenv
112+
which can be used to invoke py.test to run pytest-django's tests when
113+
developing.::
114+
115+
$ make
116+
117+
This will install a virtualenv with py.test and the latest stable version of
118+
Django. The virtualenv can then be activated with::
119+
120+
$ source bin/activate
121+
122+
Then, simply invoke py.test to run the test suite::
123+
124+
$ py.test --ds=tests.settings_sqlite
125+
126+
127+
tox can be used to run the test suite under different configurations by
128+
invoking::
129+
130+
$ tox
131+
132+
There is a huge number of unique test configurations (63 at the time of
133+
writing), running them all will take a long time. All valid configurations can
134+
be found in `tox.ini`. To test against a few of them, invoke tox with the `-e`
135+
flag::
136+
137+
$ tox -e python3.3-1.7-postgres,python2.7-1.5-sqlite
138+
139+
This will run the tests on Python 3.3/Django 1.7/PostgeSQL and Python
140+
2.7/Django 1.5/SQLite.
141+
142+
The tox and Travis CI configuration is generated by the script
143+
`generate_configurations.py` in the root directory. To add tests for a new
144+
Python or Django version, simply update the script and run it to regenerate the
145+
configuration files.
113146

114147
Measuring test coverage
115148
-----------------------

docs/database.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,7 @@ database will automatically be re-created.
104104
``--create-db`` - force re creation of the test database
105105
--------------------------------------------------------
106106
When used with ``--reuse-db``, this option will re-create the database,
107-
regardless of wheter it exists or not. This option will be ignored unless
108-
``--no-db`` is also given.
109-
107+
regardless of wheter it exists or not.
110108

111109
Example work flow with ``--reuse-db`` and ``--create-db``.
112110
-----------------------------------------------------------

docs/faq.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,19 @@ FAQ
55
I see an error saying "could not import myproject.settings"
66
-----------------------------------------------------------
77

8-
py.test breaks your sys.path. You need to either create a *setup.py* like this:
8+
py.test does not automatically add your project to the Python path, that is
9+
usually done when running tests via `manage.py test`.
10+
11+
The easiest way to get your project code available on the Python path is to
12+
create a `setup.py` like this::
913

1014
from distutils.core import setup
1115
setup(name='myproj', version='1.0')
1216

1317
And then install your project into your virtualenv with ``pip install -e .``.
1418

15-
Alternatively, you can use py.test's *conftest.py* file, or a virtualenv hook to
16-
adjust the PYTHONPATH.
17-
19+
Alternatively, when you create a `conftest.py` file in your project root, it
20+
will also implicitly add that directory to the python path.
1821

1922
How can I make sure that all my tests run with a specific locale?
2023
-----------------------------------------------------------------

docs/helpers.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ More information on fixtures is available in the `py.test documentation
8080
``rf`` - ``RequestFactory``
8181
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8282

83-
An instance of a `django.test.client.RequestFactory`_
83+
An instance of a `django.test.RequestFactory`_
8484

85-
.. _django.test.client.RequestFactory: https://docs.djangoproject.com/en/dev/topics/testing/advanced/#module-django.test.client
85+
.. _django.test.RequestFactory: https://docs.djangoproject.com/en/dev/topics/testing/advanced/#django.test.RequestFactory
8686

8787
Example
8888
"""""""
@@ -101,7 +101,7 @@ Example
101101

102102
An instance of a `django.test.Client`_
103103

104-
.. _django.test.Client: https://docs.djangoproject.com/en/dev/topics/testing/overview/#module-django.test.client
104+
.. _django.test.Client: https://docs.djangoproject.com/en/dev/topics/testing/tools/#the-test-client
105105

106106
Example
107107
"""""""

0 commit comments

Comments
 (0)