Skip to content

Commit c8aba95

Browse files
committed
improved test suite
1 parent d15f085 commit c8aba95

14 files changed

+211
-170
lines changed

.gitignore

+74-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Byte-compiled / optimized / DLL files
22
__pycache__/
33
*.py[cod]
4+
*$py.class
45

56
# C extensions
67
*.so
78

89
# Distribution / packaging
910
.Python
10-
env/
1111
build/
1212
develop-eggs/
1313
dist/
@@ -19,9 +19,13 @@ lib64/
1919
parts/
2020
sdist/
2121
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
2225
*.egg-info/
2326
.installed.cfg
2427
*.egg
28+
MANIFEST
2529

2630
# PyInstaller
2731
# Usually these files are written by a python script from a template
@@ -36,22 +40,90 @@ pip-delete-this-directory.txt
3640
# Unit test / coverage reports
3741
htmlcov/
3842
.tox/
43+
.nox/
3944
.coverage
4045
.coverage.*
4146
.cache
4247
nosetests.xml
4348
coverage.xml
44-
*,cover
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
.pytest_cache/
4553

4654
# Translations
4755
*.mo
4856
*.pot
4957

5058
# Django stuff:
5159
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
5270

5371
# Sphinx documentation
5472
docs/_build/
5573

5674
# PyBuilder
5775
target/
76+
77+
# Jupyter Notebook
78+
.ipynb_checkpoints
79+
80+
# IPython
81+
profile_default/
82+
ipython_config.py
83+
84+
# pyenv
85+
.python-version
86+
87+
# pipenv
88+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
90+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
91+
# install all needed dependencies.
92+
#Pipfile.lock
93+
94+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
95+
__pypackages__/
96+
97+
# Celery stuff
98+
celerybeat-schedule
99+
celerybeat.pid
100+
101+
# SageMath parsed files
102+
*.sage.py
103+
104+
# Environments
105+
.env
106+
.venv
107+
env/
108+
venv/
109+
ENV/
110+
env.bak/
111+
venv.bak/
112+
113+
# Spyder project settings
114+
.spyderproject
115+
.spyproject
116+
117+
# Rope project settings
118+
.ropeproject
119+
120+
# mkdocs documentation
121+
/site
122+
123+
# mypy
124+
.mypy_cache/
125+
.dmypy.json
126+
dmypy.json
127+
128+
# Pyre type checker
129+
.pyre/

.landscape.yaml

-4
This file was deleted.

.travis.yml

+6-37
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,14 @@ language: python
44
cache: pip
55
sudo: false
66

7-
matrix:
8-
include:
9-
- env: TOXENV=py34-dj111
10-
python: 3.4
11-
- env: TOXENV=py34-dj2
12-
python: 3.4
13-
- env: TOXENV=py35-dj111
14-
python: 3.5
15-
- env: TOXENV=py35-dj2
16-
python: 3.5
17-
- env: TOXENV=py35-dj21
18-
python: 3.5
19-
- env: TOXENV=py35-dj22
20-
python: 3.5
21-
- env: TOXENV=py36-dj111
22-
python: 3.6
23-
- env: TOXENV=py36-dj2
24-
python: 3.6
25-
- env: TOXENV=py36-dj21
26-
python: 3.6
27-
- env: TOXENV=py36-dj22
28-
python: 3.6
29-
- env: TOXENV=py36-dj3
30-
python: 3.6
31-
- env: TOXENV=py37-dj2
32-
python: 3.7
33-
- env: TOXENV=py37-dj21
34-
python: 3.7
35-
- env: TOXENV=py37-dj22
36-
python: 3.7
37-
- env: TOXENV=py37-dj3
38-
python: 3.7
39-
- env: TOXENV=py38-dj22
40-
python: 3.8
41-
- env: TOXENV=py38-dj3
42-
python: 3.8
7+
python:
8+
- "3.6"
9+
- "3.7"
10+
- "3.8"
11+
- "3.9"
4312

4413
install:
45-
- pip install tox
14+
- pip install tox-travis
4615

4716
script:
4817
- tox

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Authored by `Mikhail Korobov <http://kmike.ru/>`_, and some great
1818
:target: https://pypi.python.org/pypi/django-easy-maps/
1919

2020
.. image:: https://img.shields.io/travis/bashu/django-easy-maps.svg
21-
:target: https://travis-ci.org/bashu/django-easy-maps/
21+
:target: https://travis-ci.com/bashu/django-easy-maps/
2222

2323
Installation
2424
============

easy_maps/__init__.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
__version__ = "1.1.2"
2-
31
import warnings
42

53
warnings.simplefilter("default")

easy_maps/tests/__init__.py

Whitespace-only changes.

easy_maps/tests/conftest.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
Dummy conftest.py for easi_maps.
4+
If you don't know what this is for, just leave it empty.
5+
Read more about conftest.py under:
6+
https://pytest.org/latest/plugins.html
7+
"""
8+
from __future__ import print_function, absolute_import, division
9+
10+
import pytest

easy_maps/tests/models.py

Whitespace-only changes.

test_settings.py renamed to easy_maps/tests/settings.py

+24-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
1+
# -*- coding: utf-8 -*-
2+
3+
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
4+
import os
5+
import re
6+
7+
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
8+
19
SECRET_KEY = "DUMMY_SECRET_KEY"
210

11+
INTERNAL_IPS = []
12+
13+
# Application definition
14+
15+
PROJECT_APPS = ["easy_maps.tests", "easy_maps"]
16+
17+
INSTALLED_APPS = [
18+
"django.contrib.auth",
19+
"django.contrib.contenttypes",
20+
"django.contrib.staticfiles",
21+
] + PROJECT_APPS
22+
323
TEMPLATES = [
424
{
525
"BACKEND": "django.template.backends.django.DjangoTemplates",
@@ -11,6 +31,7 @@
1131
"django.template.context_processors.debug",
1232
"django.template.context_processors.i18n",
1333
"django.template.context_processors.media",
34+
"django.template.context_processors.request",
1435
"django.template.context_processors.static",
1536
"django.template.context_processors.tz",
1637
"django.contrib.messages.context_processors.messages",
@@ -19,10 +40,9 @@
1940
},
2041
]
2142

22-
DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:"}}
43+
# Database
44+
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
2345

24-
INSTALLED_APPS = [
25-
"easy_maps",
26-
]
46+
DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:"}}
2747

2848
EASY_MAPS_GOOGLE_KEY = "AIzaSyATg_isuGSCHIlJamrxAXfkFDTYhIz7ytM"

easy_maps/tests.py renamed to easy_maps/tests/test_templatetags.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from django.test import TestCase
77
from django.test.utils import override_settings
88

9-
from .models import Address
9+
from easy_maps.models import Address
1010

1111

1212
class AddressTests(TestCase):

runtests.py

-17
This file was deleted.

setup.cfg

+75-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,75 @@
1-
[wheel]
2-
# create "py2.py3-none-any.whl" package
3-
universal = 1
1+
[metadata]
2+
name = django-easy-maps
3+
version = 1.1.2
4+
description = This app makes it easy to display a map for a given address
5+
long_description = file: README.rst
6+
long_description_content_type = text/x-rst
7+
author = Mikhail Korobov
8+
author_email = [email protected]
9+
maintainer = Basil Shubin
10+
maintainer_email = [email protected]
11+
url = https://github.com/bashu/django-easy-maps
12+
download_url = https://github.com/bashu/django-easy-maps/zipball/master
13+
license = MIT License
14+
classifiers =
15+
Development Status :: 5 - Production/Stable
16+
Environment :: Web Environment
17+
Intended Audience :: Developers
18+
License :: OSI Approved :: MIT License
19+
Operating System :: OS Independent
20+
Programming Language :: Python
21+
Programming Language :: Python :: 3 :: Only
22+
Programming Language :: Python :: 3.6
23+
Programming Language :: Python :: 3.7
24+
Programming Language :: Python :: 3.8
25+
Programming Language :: Python :: 3.9
26+
Framework :: Django
27+
Framework :: Django :: 2.2
28+
Framework :: Django :: 3.0
29+
Framework :: Django :: 3.1
30+
Framework :: Django :: 3.2
31+
32+
[options]
33+
zip_safe = False
34+
include_package_data = True
35+
packages = find:
36+
install_requires =
37+
django-classy-tags>=0.6.2
38+
django-appconf
39+
geopy>=0.96
40+
41+
[options.packages.find]
42+
exclude = example*
43+
44+
[options.extras_require]
45+
develop =
46+
tox
47+
mock
48+
django
49+
pytest-django
50+
pytest
51+
test =
52+
pytest-django
53+
pytest-cov
54+
pytest
55+
mock
56+
57+
[bdist_wheel]
58+
# No longer universal (Python 3 only) but leaving this section in here will
59+
# trigger zest to build a wheel.
60+
universal = 0
61+
62+
[flake8]
63+
# Some sane defaults for the code style checker flake8
64+
# black compatibility
65+
max-line-length = 88
66+
# E203 and W503 have edge cases handled by black
67+
extend-ignore = E203, W503
68+
exclude =
69+
.tox
70+
build
71+
dist
72+
.eggs
73+
74+
[tool:pytest]
75+
DJANGO_SETTINGS_MODULE = easy_maps.tests.settings

0 commit comments

Comments
 (0)