From 05abf3582c7dd21a1dac260f2ebb6d35420ceade Mon Sep 17 00:00:00 2001 From: Daniel Roy Greenfeld Date: Wed, 24 Feb 2016 12:22:22 -0800 Subject: [PATCH] Added beginning support for py.test --- CHANGELOG.md | 6 +++++- README.rst | 5 ++++- {{cookiecutter.repo_name}}/README.rst | 7 +++++++ {{cookiecutter.repo_name}}/pytest.ini | 2 ++ {{cookiecutter.repo_name}}/requirements/local.txt | 4 ++++ {{cookiecutter.repo_name}}/requirements/test.txt | 3 +++ 6 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 {{cookiecutter.repo_name}}/pytest.ini diff --git a/CHANGELOG.md b/CHANGELOG.md index a4de0a5d..36f786b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,14 @@ All enhancements and patches to cookiecutter-django will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [2016-02-24] +### Added +- Beginning support for `py.test` (@pydanny) + ## [2016-02-18] ### Changed - The status of the registration (open or closed) is now read from the project environment instead of hardcoded in the common settings file. (@Eraldo) -- Renamed the adapter.py file to adapters.py to match the django naming convention. (@Eraldo) +- Renamed the adapter.py file to adapters.py to match the django naming convention. (@Eraldo) diff --git a/README.rst b/README.rst index d7d7dbac..a408392e 100644 --- a/README.rst +++ b/README.rst @@ -21,7 +21,7 @@ Features --------- * For Django 1.9 -* Renders Django projects with 100% test coverage +* Renders Django projects with 100% starting test coverage * Twitter Bootstrap_ v4.0.0 - alpha_ * End-to-end via Hitch_ * AngularJS_ @@ -34,6 +34,9 @@ Features * Media storage using Amazon S3 * Docker support using docker-compose_ for development and production * Procfile_ for deploying to Heroku +* Works with Python 2.7.x or 3.5.x! +* Run tests with unittest or py.test! + Optional Integrations --------------------- diff --git a/{{cookiecutter.repo_name}}/README.rst b/{{cookiecutter.repo_name}}/README.rst index cbbe3254..b9e78134 100644 --- a/{{cookiecutter.repo_name}}/README.rst +++ b/{{cookiecutter.repo_name}}/README.rst @@ -36,6 +36,13 @@ To run the tests, check your test coverage, and generate an HTML coverage report $ coverage html $ open htmlcov/index.html +Running tests with py.test +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +:: + + $ py.test + Live reloading and Sass CSS compilation ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/{{cookiecutter.repo_name}}/pytest.ini b/{{cookiecutter.repo_name}}/pytest.ini new file mode 100644 index 00000000..d19d28c5 --- /dev/null +++ b/{{cookiecutter.repo_name}}/pytest.ini @@ -0,0 +1,2 @@ +[pytest] +DJANGO_SETTINGS_MODULE=config.settings.local diff --git a/{{cookiecutter.repo_name}}/requirements/local.txt b/{{cookiecutter.repo_name}}/requirements/local.txt index 3253fdff..278f59e0 100644 --- a/{{cookiecutter.repo_name}}/requirements/local.txt +++ b/{{cookiecutter.repo_name}}/requirements/local.txt @@ -13,3 +13,7 @@ django-debug-toolbar==1.4 # improved REPL ipdb==0.8.1 + +# pytest! +pytest-django==2.9.1 +pytest-sugar=0.5.1 diff --git a/{{cookiecutter.repo_name}}/requirements/test.txt b/{{cookiecutter.repo_name}}/requirements/test.txt index 948a040b..bb7a2ae7 100644 --- a/{{cookiecutter.repo_name}}/requirements/test.txt +++ b/{{cookiecutter.repo_name}}/requirements/test.txt @@ -12,3 +12,6 @@ django_coverage_plugin==1.2.2 flake8==2.5.2 django-test-plus==1.0.11 factory_boy==2.6.0 + +# pytest! +pytest-django==2.9.1