Skip to content

Commit

Permalink
Merge pull request #53 from spyder-ide/feature/move-tests
Browse files Browse the repository at this point in the history
PR: Move tests to module so they can be run when installed
  • Loading branch information
goanpeca committed Aug 2, 2016
2 parents 9c96f44 + 7bd0ce2 commit 8f37b98
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .cache/v/cache/lastfailed
@@ -0,0 +1,3 @@
{
"qtpy/tests/test_patch_qcombobox.py": true
}
9 changes: 5 additions & 4 deletions .travis.yml
Expand Up @@ -37,8 +37,9 @@ install:
- source ci-helpers/travis/setup_conda_$TRAVIS_OS_NAME.sh
- python setup.py install

before_script:
- cd tests

script:
- py.test
- python qtpy/tests/runtests.py

after_success:
- coveralls

2 changes: 1 addition & 1 deletion appveyor.yml
Expand Up @@ -35,5 +35,5 @@ install:
build: false

test_script:
- "%CMD_IN_ENV% py.test"
- "%CMD_IN_ENV% python qtpy/tests/runtests.py"

2 changes: 1 addition & 1 deletion circle.yml
Expand Up @@ -29,5 +29,5 @@ test:
override:
- conda info --json: # note the colon
parallel: true
- "$PYTEST tests/": # note the colon
- "$PYTHON_TEST qtpy/tests/runtests.py": # note the colon
parallel: true
File renamed without changes.
26 changes: 26 additions & 0 deletions qtpy/tests/runtests.py
@@ -0,0 +1,26 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# Copyright © 2015- The Spyder Development Team
#
# Licensed under the terms of the MIT License
# ----------------------------------------------------------------------------

"""File for running tests programmatically."""

# Standard library imports
import sys

# Third party imports
import qtpy # to ensure that Qt4 uses API v2
import pytest


def main():
"""Run pytest tests."""
errno = pytest.main(['-x', 'qtpy', '-v', '-rw', '--durations=10',
'--cov=qtpy', '--cov-report=term-missing'])
sys.exit(errno)

if __name__ == '__main__':
main()
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -2,6 +2,7 @@

from qtpy import QtGui, QtWidgets


def get_qapp(icon_path=None):
qapp = QtWidgets.QApplication.instance()
if qapp is None:
Expand Down
File renamed without changes.
Empty file removed tests/__init__.py
Empty file.

0 comments on commit 8f37b98

Please sign in to comment.