Skip to content
Open
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ chromedriver_installer.egg-info/
*.pyc
MANIFEST
.cache/
venv/
.pytest_cache/
__pycache__/
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
pytest
tox
16 changes: 11 additions & 5 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class Base(object):
def _uninstall(self):
try:
subprocess.check_call(
shlex.split('pip uninstall chromedriver_installer -y')
self._get_popen_args('pip uninstall chromedriver_installer -y')
)
except subprocess.CalledProcessError:
pass
Expand All @@ -78,7 +78,13 @@ def teardown(self):

def _not_available(self):
with pytest.raises(OSError):
subprocess.check_call(shlex.split('chromedriver --version'))
subprocess.check_call(self._get_popen_args('chromedriver --version'))

def _get_popen_args(self, command):
if os.name == 'posix':
return self._get_popen_args(command, posix=os.name == 'posix')
else:
return command


class TestFailure(Base):
Expand All @@ -91,7 +97,7 @@ def test_bad_checksum(self):
)

error_message = subprocess.Popen(
shlex.split(command),
self._get_popen_args(command),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
).communicate()[0]
Expand Down Expand Up @@ -120,11 +126,11 @@ def _test_version(self, version, cached):
self._assert_cached_files_exist(cached, remove=not cached)

# After installation...
subprocess.check_call(shlex.split(self._get_install_command()))
subprocess.check_call(self._get_popen_args(self._get_install_command()))

# ...the chromedriver executable should be available...
expected_version, error = subprocess.Popen(
shlex.split('chromedriver -v'),
self._get_popen_args('chromedriver -v'),
stdout=subprocess.PIPE
).communicate()

Expand Down
5 changes: 2 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ envlist=py27, py36

[testenv]
skip_install=True
deps=
pytest
deps = -rrequirements.txt
commands=
py.test -vv tests.py
py.test -vv tests.py {posargs}