Skip to content

Commit

Permalink
:Merge branch 'issue5' of https://github.com/paylogic/pytest-splinter
Browse files Browse the repository at this point in the history
…into issue5
  • Loading branch information
Andrey Makhnach committed Jun 28, 2014
2 parents e1868fc + 7528079 commit 8dc9326
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
language: python
addons:
firefox: "28.0"
before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
Expand Down
15 changes: 11 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,22 @@


class Tox(TestCommand):
user_options = [('tox-args=', 'a', "Arguments to pass to tox")]

def initialize_options(self):
TestCommand.initialize_options(self)
self.tox_args = "--recreate"

def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = ['--recreate']
self.test_args = []
self.test_suite = True

def run_tests(self):
#import here, cause outside the eggs aren't loaded
import detox.main
errno = detox.main.main(self.test_args)
# import here, cause outside the eggs aren't loaded
import tox
import shlex
errno = tox.cmdline(args=shlex.split(self.tox_args))
sys.exit(errno)


Expand Down
2 changes: 2 additions & 0 deletions tests/test_plugin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Tests for pytest-bdd-splinter subplugin."""
import os.path
import time

import pytest

Expand Down Expand Up @@ -36,6 +37,7 @@ def test_download_file(httpserver, browser, splinter_file_download_dir):
'Content-Disposition': 'attachment; filename=some.txt',
'Content-Type': 'text/plain'})
browser.visit(httpserver.url)
time.sleep(0.5)
assert open(os.path.join(splinter_file_download_dir, 'some.txt')).read() == 'Some text file'


Expand Down
8 changes: 1 addition & 7 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
distshare={homedir}/.tox/distshare
envlist=py26,py27,py27-xdist,py33,py34
envlist=py26,py27,py33,py34
indexserver=
pypi = https://pypi.python.org/simple

Expand All @@ -11,12 +11,6 @@ deps = -r{toxinidir}/requirements-testing.txt
[testenv:py27-coverage]
commands= py.test --cov=pytest_splinter --pep8 --junitxml={envlogdir}/junit-{envname}.xml

[testenv:py27-xdist]
basepython=python2.7
commands=
py.test -n3 -rfsxX \
--junitxml={envlogdir}/junit-{envname}.xml

[pytest]
addopts=tests
pep8maxlinelength=120

0 comments on commit 8dc9326

Please sign in to comment.