Skip to content

Commit

Permalink
Merge branch 'release/2.2.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
manuphatak committed Dec 19, 2015
2 parents 53f3f6a + c8d0318 commit cb55e56
Show file tree
Hide file tree
Showing 14 changed files with 58 additions and 28 deletions.
31 changes: 31 additions & 0 deletions .coveragerc
@@ -0,0 +1,31 @@
; vi:syntax=ini
; See https://coverage.readthedocs.org/en/coverage-4.0.3/config.html

[run]
data_file = .coverage
source =
hangman

; debug = config
; branch = False
; include =
; hangman/
; omit =
; tests/

[report]
fail_under = 80
show_missing = True

; exclude_lines =
; (?i)#\s*pragma[:\s]?\s*no\s*cover
; include_errors = False
; include =
; hangman/
; omit =
; tests/
; skip_covered = False

[html]
directory = .htmlcov
title = Hangman Coverage Report
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -36,7 +36,7 @@ pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.htmlcov/
.tox/
.coverage
.coverage.*
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -16,12 +16,12 @@ env:
- TOXENV=py34
- TOXENV=py35
- TOXENV=pypy
# - TOXENV=docs
- TOXENV=docs

# command to run tests, e.g. python setup.py test
script:
- tox -e $TOXENV
- coverage run --source=hangman setup.py test
- coverage run setup.py test

after_success:
- coveralls
Expand Down
1 change: 1 addition & 0 deletions HISTORY.rst
Expand Up @@ -13,6 +13,7 @@ Next Release
* Updated requirements.
* Removed gratuitous docs -- less is more.
* 2.2.1 Handle ctrl+d EOF to exit.
* 2.2.2 Fix broken coverage report.


2.1.0 (2015-18-05)
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Expand Up @@ -51,7 +51,7 @@ clean-pyc:
clean-test:
rm -fr .tox/
rm -f .coverage
rm -fr htmlcov/
rm -fr .htmlcov/

clean-docs:
rm -f $(DOCSSOURCEDIR)/python_hangman.rst
Expand All @@ -68,10 +68,10 @@ test-all: lint
tox

coverage:
coverage run --source hangman setup.py test
coverage report --show-missing
coverage run setup.py test
coverage report
coverage html
$(BROWSER) htmlcov/index.html
$(BROWSER) .htmlcov/index.html
$(MAKE) -C docs coverage

github:
Expand Down
9 changes: 3 additions & 6 deletions README.rst
Expand Up @@ -27,10 +27,6 @@
python_hangman
==============

.. image:: https://img.shields.io/github/downloads/bionikspoon/python_hangman/total.svg
:target: https://github.com/bionikspoon/python_hangman
:alt: Github Downloads

.. image:: https://badge.fury.io/py/python_hangman.svg
:target: https://pypi.python.org/pypi/python_hangman/
:alt: Latest Version
Expand Down Expand Up @@ -63,13 +59,14 @@ A well tested, cli, python version-agnostic, multi-platform hangman game. It's b
Features
========

- Free software: MIT license
- Documentation: https://python_hangman.readthedocs.org.
- Hangman!
- Documentation: https://python_hangman.readthedocs.org
- Open Source: https://github.com/bionikspoon/python_hangman
- Idiomatic code.
- Thoroughly tested with very high coverage.
- Python version agnostic.
- Demonstrates MVC design out of the scope of web development.
- MIT license

.. image:: https://cloud.githubusercontent.com/assets/5052422/11611464/00822c5c-9b95-11e5-9fcb-8c10fd9be7df.jpg
:alt: Screenshot
Expand Down
2 changes: 0 additions & 2 deletions docs/Makefile
Expand Up @@ -180,5 +180,3 @@ pseudoxml:
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."

all: html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf latexpdfja text man texinfo info gettext changes xml pseudoxml linkcheck doctest coverage
5 changes: 3 additions & 2 deletions docs/source/readme_features.rst
@@ -1,13 +1,14 @@
Features
========

- Free software: MIT license
- Documentation: https://python_hangman.readthedocs.org.
- Hangman!
- Documentation: https://python_hangman.readthedocs.org
- Open Source: https://github.com/bionikspoon/python_hangman
- Idiomatic code.
- Thoroughly tested with very high coverage.
- Python version agnostic.
- Demonstrates MVC design out of the scope of web development.
- MIT license

.. image:: https://cloud.githubusercontent.com/assets/5052422/11611464/00822c5c-9b95-11e5-9fcb-8c10fd9be7df.jpg
:alt: Screenshot
4 changes: 0 additions & 4 deletions docs/source/readme_title.rst
Expand Up @@ -2,10 +2,6 @@
python_hangman
==============

.. image:: https://img.shields.io/github/downloads/bionikspoon/python_hangman/total.svg
:target: https://github.com/bionikspoon/python_hangman
:alt: Github Downloads

.. image:: https://badge.fury.io/py/python_hangman.svg
:target: https://pypi.python.org/pypi/python_hangman/
:alt: Latest Version
Expand Down
2 changes: 1 addition & 1 deletion hangman/__init__.py
Expand Up @@ -20,4 +20,4 @@

__author__ = 'Manu Phatak'
__email__ = 'bionikspoon@gmail.com'
__version__ = '2.2.1'
__version__ = '2.2.2'
2 changes: 1 addition & 1 deletion setup.cfg
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.2.1
current_version = 2.2.2
commit = True
tag = False
tag_name = {new_version}
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -38,7 +38,7 @@ def run_tests(self):

setup( # :off
name='python_hangman',
version='2.2.1',
version='2.2.2',
description='Python Hangman TDD/MVC demonstration.',
long_description='\n\n'.join([readme, history]),
author='Manu Phatak',
Expand Down
Empty file added tests/__init__.py
Empty file.
14 changes: 10 additions & 4 deletions tests/test_view.py
Expand Up @@ -2,7 +2,7 @@
from textwrap import dedent

from mock import Mock
from pytest import fixture, raises
from pytest import fixture, raises, mark

from hangman import view

Expand All @@ -11,12 +11,15 @@
def setup(monkeypatch):
monkeypatch.setattr('click.getchar', lambda: 'A')
monkeypatch.setattr('click.confirm', lambda _: True)
monkeypatch.setattr('click.clear', lambda: None)


@fixture
def patch_click_output(monkeypatch):
monkeypatch.setattr('click.secho', lambda *args, **_: None)
monkeypatch.setattr('click.echo', lambda *args, **_: None)
def patch_echo(monkeypatch):
noop = lambda *__, **_: None # noqa

monkeypatch.setattr('click.secho', noop)
monkeypatch.setattr('click.echo', noop)


@fixture
Expand Down Expand Up @@ -296,18 +299,21 @@ def test_flash_message_handles_error_objects(game, capsys, flash):
assert err == ''


@mark.usefixtures('patch_echo')
def test_prompting_for_a_guess():
actual = view.prompt_guess()
assert actual == 'A'


@mark.usefixtures('patch_echo')
def test_keyboard_interrupt(monkeypatch):
monkeypatch.setattr('click.getchar', lambda: '\x03')

with raises(KeyboardInterrupt):
view.prompt_guess()


@mark.usefixtures('patch_echo')
def test_prompt_play_again_method_true():
assert view.prompt_play_again() is True

Expand Down

0 comments on commit cb55e56

Please sign in to comment.