Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ before_cache:
- rm -f $HOME/.pre-commit/pre-commit.log

install:
- pip install coveralls pytest-cov
- pip install -U coveralls pytest-cov
- pip install -U wheel
- pip install -U -r requirements.txt
- pip install -U -r requirements-dev.txt
- if [[ $TRAVIS_PYTHON_VERSION != 'pypy'* ]]; then pip install ujson; fi

script:
- pytest -v --cov=telegram
- pytest -v -m nocoverage
- pytest -v -m "not nocoverage" --cov

after_success:
- coverage combine
Expand Down
16 changes: 10 additions & 6 deletions tests/test_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
# You should have received a copy of the GNU Lesser Public License
# along with this program. If not, see [http://www.gnu.org/licenses/].
import os
import subprocess
import sys
from platform import python_implementation

Expand All @@ -26,17 +25,22 @@

def call_pre_commit_hook(hook_id):
__tracebackhide__ = True
return os.system(' '.join(['pre-commit', 'run', '--all-files', hook_id]))
return os.system(' '.join(['pre-commit', 'run', '--all-files', hook_id])) # pragma: no cover


@pytest.mark.nocoverage
@pytest.mark.parametrize('hook_id', argvalues=('yapf', 'flake8', 'pylint'))
@pytest.mark.skipif(not os.getenv('TRAVIS'), reason='Not running in travis.')
@pytest.mark.skipif(not sys.version_info[:2] == (3, 6) or python_implementation() != 'CPython',
reason='Only running pre-commit-hooks on newest tested python version, '
'as they are slow and consistent across platforms.')
reason='Only running pre-commit-hooks on newest tested python version, '
'as they are slow and consistent across platforms.')
def test_pre_commit_hook(hook_id):
assert call_pre_commit_hook(hook_id) == 0
assert call_pre_commit_hook(hook_id) == 0 # pragma: no cover


@pytest.mark.nocoverage
@pytest.mark.skipif(
not sys.version_info[:2] in ((3, 6), (2, 7)) or python_implementation() != 'CPython',
reason='Only testing build on 2.7 and 3.6')
def test_build():
assert os.system('python setup.py bdist_dumb') == 0
assert os.system('python setup.py bdist_dumb') == 0 # pragma: no cover