def main(): print('\n\n\n%s\n Python: %s, Django: %s\n%s\n' % ('=' * 120, '.'.join(map(str, sys.version_info[:3])), '.'.join( map(str, django.VERSION[:3])), '-' * 120)) import logging logging.basicConfig(level=logging.ERROR) from conftest import pytest_configure settings = pytest_configure() from django.test.utils import get_runner test_runner = get_runner(settings)(verbosity=2, interactive=True) original_suite_result = test_runner.suite_result def patched_suite_result(suite, result, **kwargs): from formapi.tests import TOTAL_TESTS assert result.testsRun == TOTAL_TESTS, \ "Run %s tests, expected to run %s" % ( result.testsRun, TOTAL_TESTS) return original_suite_result(suite, result, **kwargs) test_runner.suite_result = patched_suite_result failures = test_runner.run_tests(['formapi']) sys.exit(failures)
def main(): from conftest import pytest_configure settings = pytest_configure() from django.test.utils import get_runner test_runner = get_runner(settings)(verbosity=2, interactive=True) failures = test_runner.run_tests(['formapi']) sys.exit(failures)
# # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) sys.path.insert(0, os.path.abspath('../tests')) from conftest import pytest_configure pytest_configure() # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.viewcode' ] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates']
# # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/stable/config # -- Path setup -------------------------------------------------------------- # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # import os import sys sys.path.insert(0, '../tests') import conftest conftest.pytest_configure() # -- Project information ----------------------------------------------------- project = u'dkdj' copyright = u'2018, Bjorn Pettersen' author = u'Bjorn Pettersen' # The short X.Y version version = '3.0.67' # The full version, including alpha/beta/rc tags release = '3.0.67' # -- General configuration --------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here.
#!/usr/bin/env python import sys if __name__ == "__main__": try: from django.core.management import execute_from_command_line from conftest import pytest_configure except ImportError as exc: raise ImportError( "Couldn't import Django. Are you sure it's installed and " "available on your PYTHONPATH environment variable? Did you " "forget to activate a virtual environment?") from exc pytest_configure(debug=True) execute_from_command_line(sys.argv)