Exclude tests from distribution

fixes #258
This commit is contained in:
Bruno Alla 2017-02-15 23:00:10 +00:00
parent 4d5969a616
commit 10ebc16271
25 changed files with 28 additions and 33 deletions

View file

@ -5,11 +5,10 @@ import os, sys
from django.conf import settings
import django
DEFAULT_SETTINGS = dict(
INSTALLED_APPS=(
'model_utils',
'model_utils.tests',
'tests',
),
DATABASES={
"default": {
@ -31,7 +30,7 @@ def runtests():
from django.test.runner import DiscoverRunner
runner_class = DiscoverRunner
test_args = ['model_utils.tests']
test_args = ['tests']
failures = runner_class(
verbosity=1, interactive=True, failfast=False).run_tests(test_args)

View file

@ -30,7 +30,7 @@ setup(
author='Carl Meyer',
author_email='carl@oddbird.net',
url='https://github.com/carljm/django-model-utils/',
packages=find_packages(),
packages=find_packages(exclude=['tests*']),
install_requires=['Django>=1.8'],
classifiers=[
'Development Status :: 5 - Production/Stable',
@ -39,7 +39,6 @@ setup(
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
@ -49,7 +48,6 @@ setup(
],
zip_safe=False,
tests_require=['Django>=1.8'],
test_suite='runtests.runtests',
package_data={
'model_utils': [
'locale/*/LC_MESSAGES/django.po','locale/*/LC_MESSAGES/django.mo'

View file

@ -1,4 +1,4 @@
from __future__ import unicode_literals
from __future__ import unicode_literals, absolute_import
from django.db import models
from django.db.models import Manager
@ -14,8 +14,8 @@ from model_utils.models import (
TimeFramedModel,
TimeStampedModel,
)
from model_utils.tests.fields import MutableField
from model_utils.tests.managers import CustomSoftDeleteManager
from tests.fields import MutableField
from tests.managers import CustomSoftDeleteManager
from model_utils.tracker import FieldTracker, ModelTracker

View file

@ -7,7 +7,7 @@ from django.core.exceptions import FieldError
from django.test import TestCase
from model_utils import FieldTracker
from model_utils.tests.models import (
from tests.models import (
Tracked, TrackedFK, InheritedTrackedFK, TrackedNotDefault, TrackedNonFieldAttr, TrackedMultiple,
InheritedTracked, TrackedFileField,
ModelTracked, ModelTrackedFK, ModelTrackedNotDefault, ModelTrackedMultiple, InheritedModelTracked,

View file

@ -7,7 +7,7 @@ from freezegun import freeze_time
from django.test import TestCase
from model_utils.fields import MonitorField
from model_utils.tests.models import Monitored, MonitorWhen, MonitorWhenEmpty, DoubleMonitored
from tests.models import Monitored, MonitorWhen, MonitorWhenEmpty, DoubleMonitored
class MonitorFieldTests(TestCase):

View file

@ -3,7 +3,7 @@ from __future__ import unicode_literals
from django.utils.six import text_type
from django.test import TestCase
from model_utils.tests.models import Article, SplitFieldAbstractParent
from tests.models import Article, SplitFieldAbstractParent
class SplitFieldTests(TestCase):

View file

@ -3,7 +3,7 @@ from __future__ import unicode_literals
from django.test import TestCase
from model_utils.fields import StatusField
from model_utils.tests.models import (
from tests.models import (
Article, StatusFieldDefaultFilled, StatusFieldDefaultNotFilled,
StatusFieldChoicesName,
)

View file

@ -6,7 +6,7 @@ import django
from django.db import models
from django.test import TestCase
from model_utils.tests.models import (InheritanceManagerTestRelated, InheritanceManagerTestGrandChild1,
from tests.models import (InheritanceManagerTestRelated, InheritanceManagerTestGrandChild1,
InheritanceManagerTestGrandChild1_2, InheritanceManagerTestParent,
InheritanceManagerTestChild1,
InheritanceManagerTestChild2, TimeFrame, InheritanceManagerTestChild3

View file

@ -2,7 +2,7 @@ from __future__ import unicode_literals
from django.test import TestCase
from model_utils.tests.models import Post
from tests.models import Post
class QueryManagerTests(TestCase):

View file

@ -2,7 +2,7 @@ from __future__ import unicode_literals
from django.test import TestCase
from model_utils.tests.models import CustomSoftDelete
from tests.models import CustomSoftDelete
class CustomSoftDeleteManagerTests(TestCase):

View file

@ -6,7 +6,7 @@ from django.test import TestCase
from model_utils.managers import QueryManager
from model_utils.models import StatusModel
from model_utils.tests.models import StatusManagerAdded
from tests.models import StatusManagerAdded
class StatusManagerAddedTests(TestCase):

View file

@ -3,7 +3,7 @@ from __future__ import unicode_literals
from django.db.utils import ConnectionDoesNotExist
from django.test import TestCase
from model_utils.tests.models import SoftDeletable
from tests.models import SoftDeletable
class SoftDeletableModelTests(TestCase):

View file

@ -4,7 +4,7 @@ from freezegun import freeze_time
from django.test.testcases import TestCase
from model_utils.tests.models import Status, StatusPlainTuple, StatusCustomManager
from tests.models import Status, StatusPlainTuple, StatusCustomManager
class StatusModelTests(TestCase):

View file

@ -8,7 +8,7 @@ from django.test import TestCase
from model_utils.managers import QueryManager
from model_utils.models import TimeFramedModel
from model_utils.tests.models import TimeFrame, TimeFrameManagerAdded
from tests.models import TimeFrame, TimeFrameManagerAdded
class TimeFramedModelTests(TestCase):

View file

@ -6,7 +6,7 @@ from freezegun import freeze_time
from django.test import TestCase
from model_utils.tests.models import TimeStamp
from tests.models import TimeStamp
class TimeStampedModelTests(TestCase):

View file

@ -20,4 +20,4 @@ deps =
django_trunk: https://github.com/django/django/tarball/master
freezegun == 0.3.8
commands = coverage run -a setup.py test
commands = coverage run runtests.py

View file

@ -1,16 +1,14 @@
#!/usr/bin/env python
import os
import sys
from django.conf import settings
import django
DEFAULT_SETTINGS = dict(
INSTALLED_APPS=(
'model_utils',
'model_utils.tests',
'tests',
),
DATABASES={
"default": {