Skip to content

ensure backward compatibilty with multiple python versions #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 58 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,59 @@
*.log
*.pot
*.pyc
local_settings.py
# python compiled source and temporary files #
##############################################

*.py[co]
*~

# HG, SVN #
###########

.svn
.hg
.hgignore

# Sqlite base #
###############

sqlite3

# gettext compiled file #
#########################

*.pot
*.mo

# Buildout directories and files #
##################################

*.sublime-project
*.sublime-workspace
*.egg-info
docs
local

bin
lib
dist
eggs
parts
build
include
downloads
src_eggs
uploads
develop-eggs
cfc.egg-info

.installed.cfg
Makefile
bootstrap.py
buildout.cfg
mydatabase.db
versions.cfg

# Misc #
########

.tox
profiler_test
*.log
16 changes: 0 additions & 16 deletions profiler/tests.py

This file was deleted.

4 changes: 4 additions & 0 deletions profiler/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# coding=utf-8
from __future__ import unicode_literals

from .tests import ProfilerTests # NOQA
19 changes: 19 additions & 0 deletions profiler/tests/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# coding=utf-8
from __future__ import absolute_import, unicode_literals
"""
django-live-profiler.tests.settings
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Contains the settings to be used when running the test suite.
"""
from os.path import dirname, join

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'mydatabase'
}
}

LOCALE_PATHS = (join(dirname(dirname(__file__)), 'locale'),)
INSTALLED_APPS = ['profiler']
SECRET_KEY = '*'
9 changes: 9 additions & 0 deletions profiler/tests/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from django.test import SimpleTestCase

from ..models import SQLCompiler


class ProfilerTests(SimpleTestCase):

def test_first(self):
self.assertTrue(SQLCompiler.execute_sql)
65 changes: 65 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
[tox]
downloadcache = {toxworkdir}/cache/
envlist =
py26-1.4,
py26-1.5,
py27-1.4,
py27-1.5,
#pypy-1.4,
#pypy-1.5,
#py32-1.5,
py33-1.5

[testenv]
setenv =
PYTHONPATH = .
DJANGO_SETTINGS_MODULE = profiler.tests.settings
commands =
django-admin.py test profiler

[testenv:py26-1.4]
basepython = python2.6
deps =
Django==1.5.1

[testenv:py26-1.5]
basepython = python2.6
deps =
Django==1.5.1

[testenv:py27-1.4]
basepython = python2.7
deps =
Django==1.4.3

[testenv:py27-1.5]
basepython = python2.7
deps =
Django==1.5.1

[testenv:pypy-1.4]
basepython = pypy
deps =
Django==1.4.3

# Django 1.5 not compatible with pypy 1.9...
[testenv:pypy-1.5]
basepython = pypy
deps =
Django==1.5.1

[testenv:py32-1.5]
basepython = python3.2
deps =
Django==1.5.1

[testenv:py33-1.5]
basepython = python3.3
deps =
Django==1.5.1

# Test Django trunk : 1.6 actually
[testenv:py27-trunk]
basepython = python2.7
deps =
https://github.com/django/django/tarball/master#egg=Django