Skip to content

Commit

Permalink
Revert "Merge branch 'devel' for version release"
Browse files Browse the repository at this point in the history
This reverts commit f174f89, reversing
changes made to ad0fcda.
  • Loading branch information
jinnatar committed Apr 12, 2018
1 parent d247641 commit 62d0682
Show file tree
Hide file tree
Showing 39 changed files with 493 additions and 984 deletions.
15 changes: 0 additions & 15 deletions .coveragerc

This file was deleted.

3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
*.cfg
*.pyc
*.egg-info
.eggs
MANIFEST
dist/
build/
prof/
.cache/
.pytest_cache/
.coverage
.tox
4 changes: 0 additions & 4 deletions .style.yapf

This file was deleted.

32 changes: 4 additions & 28 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,11 @@ python:
- "3.5"
- "3.6"
cache: pip

env:
- SET="-m logic"
- SET="-m live"
- SET="-m destructive"

before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq graphviz
script:
- pytest

install:
- pip install --quiet -r requirements.txt -r test_requirements.txt

before_script:
- mkdir -p $HOME/$DEST
- curl -u $KEY $HOST/$FILE > $HOME/$DEST/$FILE

script:
- coverage run setup.py test --addopts "--profile-svg $SET"
- pip install --quiet python-coveralls -r requirements.txt

after_success:
- codecov

before_deploy:
- util/gist-conf.sh $GIST

deploy:
provider: script
script: gist create "Travis $TRAVIS_REPO_SLUG $TRAVIS_JOB_NUMBER $SET" prof/combined.svg
on:
all_branches: true
skip_cleanup: true
- coveralls
22 changes: 10 additions & 12 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -161,26 +161,24 @@ New releases are cut from the devel branch as needed.
Tests
~~~~~
pytest is used for unit tests.

- Certain tests are marked as "live" tests and require an active authentication state and a real hub to query against. Live tests are non-destructive.
- Some tests are marked as "destructive" and will cause changes such as a light being turned on or tokens getting invalidated on purpose.
- Most tests are marked as "logic" and do not require anything external. If no set is defined, only logic tests are run.
Certain tests are marked as "live" tests and require an active authentication state and a real hub to query against. Live tests are non-destructive.
Some tests are marked as "destructive" and will cause changes such as a light being turned on or tokens getting invalidated on purpose.

During development you can run the test suite right from the source directory:

.. code:: console
pytest
# or run only live tests:
pytest -m live
# run everything except destructive tests:
pytest -m "not destructive"
# or include the live tests as well:
pytest --live
# or for the brave, also run destructive tests (also implies --live):
pytest--destructive
To run the test suite on an already installed python-cozify (defining a set is mandatory, otherwise ALL sets are run including destructive):
To run the test suite on an already installed python-cozify:

.. code:: console
pytest -v -m logic --pyargs cozify
pytest --pyargs cozify
Unfortunately there doesn't seem to be a way to pass the --live argument in this case without first entering the system directory where the module was installed.

Expand All @@ -199,5 +197,5 @@ Roadmap, aka. Current Limitations
.. |ci| image:: https://travis-ci.org/Artanicus/python-cozify.svg?branch=master
:target: https://travis-ci.org/Artanicus/python-cozify

.. |coverage| image:: https://codecov.io/gh/Artanicus/python-cozify/branch/master/graph/badge.svg
:target: https://codecov.io/gh/Artanicus/python-cozify
.. |coverage| image:: https://coveralls.io/repos/github/Artanicus/python-cozify/badge.svg?branch=master
:target: https://coveralls.io/github/Artanicus/python-cozify?branch=master
23 changes: 23 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import pytest

def pytest_addoption(parser):
parser.addoption("--live", action="store_true",
default=False, help="run tests requiring a functional auth and a real hub.")
parser.addoption("--destructive", action="store_true",
default=False, help="run tests that require and modify the state of a real hub.")

def pytest_collection_modifyitems(config, items):
live = False
destructive = False
if config.getoption("--live"):
live = True
if config.getoption("--destructive"):
return
skip_live = pytest.mark.skip(reason="need --live option to run")
skip_destructive = pytest.mark.skip(reason="need --destructive option to run")

for item in items:
if "live" in item.keywords and not live:
item.add_marker(skip_live)
if "destructive" in item.keywords and not destructive:
item.add_marker(skip_destructive)
1 change: 0 additions & 1 deletion cozify/Error.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def __init__(self, status_code, message):
def __str__(self):
return 'API error, %s: %s' % (self.status_code, self.message)


class AuthenticationError(Exception):
"""Error raised for nonrecoverable authentication failures.
Expand Down
2 changes: 1 addition & 1 deletion cozify/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.2.15"
__version__ = "0.2.14"
Loading

0 comments on commit 62d0682

Please sign in to comment.