Skip to content
This repository has been archived by the owner on Mar 21, 2022. It is now read-only.

Commit

Permalink
sdd
Browse files Browse the repository at this point in the history
  • Loading branch information
bh committed May 10, 2014
1 parent 2f9a78f commit 2aefaa0
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 9 deletions.
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
language: python

before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3

env:
- TOX_ENV=py27
- TOX_ENV=py27-withgui

python:
- "2.7"

install:
- "pip install tox==1.7.1"
- "pip install tox==1.7.1 coveralls"

script:
- "tox -e $TOX_ENV"
Expand Down
3 changes: 1 addition & 2 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
[pytest]
norecursedirs = .tox
requirements
addopts = --cov-report html --cov=keepass_http --cov-report=term-missing tests
27 changes: 26 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# -*- coding: utf-8 -*-
from setuptools import find_packages, setup
from setuptools.command.test import test as TestCommand

import sys

class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
print sys.argv
self.test_args = []
self.test_suite = True

def run_tests(self):
#import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)

#with open("requirements/testing.txt") as x:
# test_requirements = x.read().splitlines()

with open("README.rst") as readme_file:
long_description = readme_file.read()
Expand All @@ -21,7 +40,7 @@
"flask==0.10.1",
"keepass==1.2",
"libkeepass==0.1.2",
"lxml>=3.2"),
"lxml==3.2.1"),
extras_require = {
'GUI': ("PySide==1.2.2",)
},
Expand All @@ -34,5 +53,11 @@
'application/x-keepass-database-v2 = keepass_http.backends.libkeepass_backend:Backend'
],
},
tests_require=["pytest==2.5.2",
"pytest-cov==1.6",
"coveralls==0.4.2",
"mock==1.0.1",
],
cmdclass = {'test': PyTest},
zip_safe=False
)
22 changes: 17 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
[tox]
envlist = py27
envlist = py27,
py27-withgui

[py27]
basepython = python2.7
[base]
whitelist_externals = make
deps = -rrequirements/testing.txt
commands = make run_tests

[testenv:py27]
basepython = python2.7
whitelist_externals = {[base]whitelist_externals}
commands = python setup.py test

[testenv:py27-withgui]
basepython = python2.7
whitelist_externals = {[base]whitelist_externals}
commands = python setup.py test
deps = PySide==1.2.2
pytest-qt==1.0.2


0 comments on commit 2aefaa0

Please sign in to comment.