Skip to content

Commit 27b7f3a

Browse files
committed
Fix tests
1 parent 95810c4 commit 27b7f3a

File tree

5 files changed

+18
-12
lines changed

5 files changed

+18
-12
lines changed

Makefile

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
BUILDDIR=_build
21
MODULE=django_markdown
3-
SPHINXBUILD=sphinx-build
4-
ALLSPHINXOPTS= -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
52
VIRTUALENV=$(shell echo "$${VDIR:-'.env'}")
63

74
all: $(VIRTUALENV)
@@ -15,9 +12,9 @@ help:
1512
# target: clean - Clean repo
1613
clean:
1714
@rm -rf build dist docs/_build
18-
find $(CURDIR)/$(MODULE) -name "*.pyc" -delete
19-
find $(CURDIR)/$(MODULE) -name "*.orig" -delete
20-
find $(CURDIR)/$(MODULE) -name "__pycache__" -delete
15+
find $(CURDIR) -name "*.pyc" -delete
16+
find $(CURDIR) -name "*.orig" -delete
17+
find $(CURDIR) -name "__pycache__" | xargs rm -rf
2118

2219

2320
# ==============
@@ -79,13 +76,17 @@ docs:
7976

8077
$(VIRTUALENV): requirements.txt
8178
[ -d $(VIRTUALENV) ] || @virtualenv --no-site-packages $(VIRTUALENV)
82-
@$(VIRTUALENV)/bin/pip install -M -r requirements.txt
79+
@$(VIRTUALENV)/bin/pip install -r requirements.txt
8380
touch $(VIRTUALENV)
8481

82+
$(VIRTUALENV)/bin/py.test: requirements-tests.txt $(VIRTUALENV)
83+
@$(VIRTUALENV)/bin/pip install -r requirements-tests.txt
84+
touch $(VIRTUALENV)/bin/py.test
85+
8586
.PHONY: t
8687
# target: t - Runs tests
87-
t: clean
88-
$(VIRTUALENV)/bin/python setup.py test
88+
t: clean $(VIRTUALENV)/bin/py.test
89+
@$(VIRTUALENV)/bin/py.test
8990

9091
$(CURDIR)/example/db.sqlite3: $(VIRTUALENV)
9192
$(VIRTUALENV)/bin/python example/manage.py syncdb --noinput

requirements-tests.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-e .
2+
3+
pytest
4+
pytest-django
5+
ipdb

setup.py

-2
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ def _read(fname):
5757
package_data={'': PACKAGE_DATA, },
5858

5959
install_requires=install_requires,
60-
tests_require=install_requires,
61-
test_suite='tests',
6260
)
6361

6462
# pylama:ignore=C0111

tests/settings.py

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
ROOT_URLCONF = 'tests.urls'
88

99
SECRET_KEY = 'KeepMeSecret'
10+
STATIC_URL = '/static/'
1011

1112
DEBUG = True
1213

tox.ini

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ ignore=D,C0111,E501,C0301
1818
ignore=E501,C0301
1919

2020
[pytest]
21-
addopts = -x tests/__init__.py
21+
DJANGO_SETTIGNS_MODULE=tests
22+
addopts = -sx tests/__init__.py
2223

2324
[testenv]
2425
commands=py.test

0 commit comments

Comments
 (0)