Skip to content

Commit

Permalink
Merging in gisle's awesome work
Browse files Browse the repository at this point in the history
  • Loading branch information
pydanny committed Mar 14, 2011
1 parent 07e0ad2 commit 8fb9790
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 24 deletions.
5 changes: 1 addition & 4 deletions apps/grid/fixtures/test_initial_data.json
Expand Up @@ -95,7 +95,6 @@
"participants" : "malcomt,jacobian",
"pypi_downloads" : 0,
"pypi_url" : "",
"pypi_version" : "",
"related_packages" : [ ],
"repo" : 1,
"repo_commits" : 0,
Expand All @@ -115,7 +114,6 @@
"participants" : "thetestman",
"pypi_downloads" : 0,
"pypi_url" : "",
"pypi_version" : "",
"related_packages" : [ ],
"repo" : 1,
"repo_commits" : 0,
Expand All @@ -135,7 +133,6 @@
"participants" : "pydanny",
"pypi_downloads" : 0,
"pypi_url" : "",
"pypi_version" : "",
"related_packages" : [ ],
"repo" : 1,
"repo_commits" : 0,
Expand Down Expand Up @@ -239,4 +236,4 @@
"active": true
}
}
]
]
5 changes: 1 addition & 4 deletions apps/homepage/fixtures/test_initial_data.json
Expand Up @@ -95,7 +95,6 @@
"participants" : "malcomt,jacobian",
"pypi_downloads" : 0,
"pypi_url" : "",
"pypi_version" : "",
"related_packages" : [ ],
"repo" : 1,
"repo_commits" : 0,
Expand All @@ -115,7 +114,6 @@
"participants" : "thetestman",
"pypi_downloads" : 0,
"pypi_url" : "",
"pypi_version" : "",
"related_packages" : [ ],
"repo" : 1,
"repo_commits" : 0,
Expand All @@ -135,7 +133,6 @@
"participants" : "pydanny",
"pypi_downloads" : 0,
"pypi_url" : "",
"pypi_version" : "",
"related_packages" : [ ],
"repo" : 1,
"repo_commits" : 0,
Expand Down Expand Up @@ -239,4 +236,4 @@
"active": true
}
}
]
]
5 changes: 1 addition & 4 deletions apps/package/fixtures/test_initial_data.json
Expand Up @@ -95,7 +95,6 @@
"participants" : "malcomt,jacobian",
"pypi_downloads" : 0,
"pypi_url" : "",
"pypi_version" : "",
"related_packages" : [ ],
"repo" : 1,
"repo_commits" : 0,
Expand All @@ -115,7 +114,6 @@
"participants" : "thetestman",
"pypi_downloads" : 0,
"pypi_url" : "",
"pypi_version" : "",
"related_packages" : [ ],
"repo" : 1,
"repo_commits" : 0,
Expand All @@ -135,7 +133,6 @@
"participants" : "pydanny",
"pypi_downloads" : 0,
"pypi_url" : "",
"pypi_version" : "",
"related_packages" : [ ],
"repo" : 1,
"repo_commits" : 0,
Expand Down Expand Up @@ -239,4 +236,4 @@
"active": true
}
}
]
]
3 changes: 3 additions & 0 deletions coverage/.gitignore
@@ -0,0 +1,3 @@
#
/*.html
/modules
4 changes: 3 additions & 1 deletion requirements/project.txt
Expand Up @@ -13,4 +13,6 @@ python-dateutil==1.5
django-reversion==1.3.1
django-sorting==0.1
bzr==2.3.1
launchpadlib==1.9.8
launchpadlib==1.9.8
coverage==3.4
django-coverage==1.1.1
31 changes: 20 additions & 11 deletions settings.py
Expand Up @@ -146,6 +146,16 @@
"homepage.context_processors.current_path",
]

PROJECT_APPS = [
"about",
"grid",
"homepage",
"package",
"profiles",
"searchv1",
"apiv1",
]

INSTALLED_APPS = [
# Django
"django.contrib.admin",
Expand Down Expand Up @@ -181,16 +191,7 @@
"pinax.apps.account",
"pinax.apps.signup_codes",
"pinax.apps.analytics",

# project
"about",
"grid",
"homepage",
"package",
"profiles",
"searchv1",
"apiv1",
]
] + PROJECT_APPS

FIXTURE_DIRS = [
os.path.join(PROJECT_ROOT, "fixtures"),
Expand Down Expand Up @@ -250,7 +251,15 @@
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)


#TEST_RUNNER = 'testrunner.OurTestRunner'
TEST_RUNNER = 'testrunner.OurCoverageRunner'

COVERAGE_MODULE_EXCLUDES = [
'tests$', 'settings$', 'urls$', 'locale$', 'migrations', 'fixtures',
] + INSTALLED_APPS[:-len(PROJECT_APPS)]
COVERAGE_REPORT_HTML_OUTPUT_DIR = "coverage"


# local_settings.py can be used to override environment-specific settings
# like database and email that differ between development and production.
Expand Down
12 changes: 12 additions & 0 deletions testrunner.py
@@ -0,0 +1,12 @@
# Make our own testrunner that by default only tests our own apps

from django.conf import settings
from django.test.simple import DjangoTestSuiteRunner
from django_coverage.coverage_runner import CoverageRunner

class OurTestRunner(DjangoTestSuiteRunner):
def build_suite(self, test_labels, *args, **kwargs):
return super(OurTestRunner, self).build_suite(test_labels or settings.PROJECT_APPS, *args, **kwargs)

class OurCoverageRunner(OurTestRunner, CoverageRunner):
pass

0 comments on commit 8fb9790

Please sign in to comment.