Skip to content

Commit 82e276b

Browse files
committed
Merge branch 'master' into fixturefix
This merge is very broken and needs further fixing Conflicts: pytest_django/compat.py pytest_django/db_reuse.py pytest_django/fixtures.py pytest_django/plugin.py tests/test_database.py
2 parents 9563a7f + 5886e05 commit 82e276b

30 files changed

+1642
-215
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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
.PHONY: docs test clean
22

3+
testenv: bin/py.test
4+
5+
36
bin/python:
47
virtualenv .
58

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: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
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+
2.6.1
10+
-----
11+
This is a bugfix/support release with no new features:
12+
13+
* Added support for Django 1.7 beta and Django master as of 2014-04-16.
14+
pytest-django is now automatically tested against the latest git master
15+
version of Django.
16+
17+
* Support for MySQL with MyISAM tables. Thanks to Zach Kanzler and Julen Ruiz
18+
Aizpuru for fixing this. This fixes issue #8 #64.
19+
320
2.6.0
421
-----
522
* Experimental support for Django 1.7 / Django master as of 2014-01-19.
@@ -8,6 +25,12 @@ Changelog
825
Django. The support is experimental since Django 1.7 is not yet released, but
926
the goal is to always be up to date with the latest Django master
1027

28+
2.5.1
29+
-----
30+
Invalid release accidentally pushed to PyPI (identical to 2.6.1). Should not be
31+
used - use 2.6.1 or newer to avoid confusion.
32+
33+
1134
2.5.0
1235
-----
1336
* 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/faq.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ Activate a specific locale in your project's ``conftest.py``::
3030

3131
My tests are not being picked up when I run py.test from the root directory. Why not?
3232
-------------------------------------------------------------------------------------
33-
By default, py.test looks for tests in files named ``test*.py``. If you have your
34-
tests in files with other names, they will not be collected. It is common to put tests under
33+
By default, py.test looks for tests in files named ``test_*.py`` (note that this is not the same as ``test*.py``).
34+
If you have your tests in files with other names, they will not be collected. It is common to put tests under
3535
``app_directory/tests/views.py``. To find those tests, create a ``pytest.ini`` file in your
3636
project root with the contents::
3737

0 commit comments

Comments
 (0)