Skip to content

Commit

Permalink
Travis: Clean up config, update pytest invocation (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
tony authored Dec 24, 2019
2 parents 23bc47a + 5d2e1e1 commit dc85e97
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 43 deletions.
16 changes: 5 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,14 @@ sudo: false
dist: bionic # 18.04
python:
- 2.7
- 3.6
- 3.7
- pypy3
if: (type = push AND branch IN (master)) OR (type = pull_request)
cache: pip
before_install:
- export PIP_USE_MIRRORS=true
- pip install -U pip setuptools
- pip install -U pytest mock # https://github.com/travis-ci/travis-ci/issues/4873
- pip install coveralls
- git config --global user.name 'travis-ci'
- git config --global user.email 'travis@nowhere.edu'
cache:
- pip
install:
- "pip install -e ."
script: coverage run --source=cihai_cli setup.py test
- pip install -e .
- pip install -r requirements/test.txt
script: py.test --cov=cihai_cli
after_success:
- bash <(curl -s https://codecov.io/bash)
2 changes: 2 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ pytest = "*"
cihai-cli = {path = ".",editable = true}
black = "==19.10b0"
sphinx-issues = "*"
pytest-cov = "*"
coverage = "*"

[packages]
cihai = "~=0.9.0"
Expand Down
147 changes: 134 additions & 13 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion requirements/test.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
pytest<=5.1.0
pytest<=6
pytest-cov
coverage
18 changes: 0 additions & 18 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import sys

from setuptools import setup
from setuptools.command.test import test as TestCommand

about = {}
with open("cihai_cli/__about__.py") as fp:
Expand All @@ -22,22 +21,6 @@
readme = open('README.rst').read()

history = open('CHANGES').read().replace('.. :changelog:', '')


class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]

def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = []

def run_tests(self):
import pytest

errno = pytest.main(self.pytest_args)
sys.exit(errno)


setup(
name=about['__title__'],
version=about['__version__'],
Expand All @@ -57,7 +40,6 @@ def run_tests(self):
include_package_data=True,
install_requires=install_reqs,
tests_require=tests_reqs,
cmdclass={'test': PyTest},
zip_safe=False,
keywords=about['__title__'],
entry_points=dict(console_scripts=['cihai=cihai_cli.cli:cli']),
Expand Down

0 comments on commit dc85e97

Please sign in to comment.