Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Move tests to module so they can be run when installed #53

Merged
merged 3 commits into from
Aug 2, 2016
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
3 changes: 3 additions & 0 deletions .cache/v/cache/lastfailed
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"qtpy/tests/test_patch_qcombobox.py": true
}
9 changes: 5 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
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.