Skip to content

Commit

Permalink
Drop python 2.7 support (incl. PyPy)
Browse files Browse the repository at this point in the history
Also in this PR:
- Add support for python 3.8 (incl. CI)
- Drop support for PhantomJS
  • Loading branch information
BeyondEvil committed Jul 16, 2020
1 parent 3126dff commit 6e355ce
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 92 deletions.
27 changes: 6 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ jobs:
include:
- stage: Tests
name: Linting
python: 3.7
dist: xenial
sudo: required
python: 3.8
before_install: skip
addons: skip
env: TOXENV=linting
Expand All @@ -15,18 +13,11 @@ jobs:

-
name: Docs
python: 3.7
dist: xenial
sudo: required
python: 3.8
before_install: skip
addons: skip
env: TOXENV=docs

-
name: python 2.7
python: 2.7
env: TOXENV=py27

-
name: python 3.6
python: 3.6
Expand All @@ -35,24 +26,20 @@ jobs:
-
name: python 3.7
python: 3.7
dist: xenial
sudo: required
env: TOXENV=py37

-
name: pypy
python: pypy
env: TOXENV=pypy
name: python 3.8
python: 3.8
env: TOXENV=py38

-
name: pypy3
python: pypy3
env: TOXENV=pypy3

- stage: deploy
python: 3.7
dist: xenial
sudo: required
python: 3.8
before_install: skip
install: skip
script: skip
Expand All @@ -67,8 +54,6 @@ jobs:
tags: true
repo: pytest-dev/pytest-selenium

sudo: required

env:
global:
- PYTEST_ADDOPTS="-m 'not (edge or safari or phantomjs)'"
Expand Down
2 changes: 1 addition & 1 deletion docs/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Installation
Requirements
------------

pytest-selenium will work with Python >=3.6 and 2.7.
pytest-selenium will work with Python >=3.6.

Install pytest-selenium
-----------------------
Expand Down
10 changes: 10 additions & 0 deletions docs/news.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
Release Notes
=============

2.0.0 (unreleased)
------------------

* Drop python 2.7 support (incl. PyPy)

* Add python 3.8 support

* Drop `PhantomJS` support


1.17.0 (2019-07-13)
-------------------

Expand Down
33 changes: 0 additions & 33 deletions docs/user_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -216,39 +216,6 @@ option to indicate where it can be found::

pytest --driver IE --driver-path \path\to\IEDriverServer.exe

PhantomJS
---------
**NOTE:** Support for PhantomJS has been deprecated and will be removed in a
future release. If running headless is a requirement, please consider using
Firefox or Chrome instead.

To use PhantomJS, you will need `download it <http://phantomjs.org/download.html>`_
and specify ``PhantomJS`` for the ``--driver`` command line option. If
the driver executable is not available on your path, you can use the
``--driver-path`` option to indicate where it can be found::

pytest --driver PhantomJS --driver-path /path/to/phantomjs

See the `PhantomJS documentation <http://phantomjs.org/quick-start.html>`_ for
more information.

Configuration
~~~~~~~~~~~~~

PhantomJS supports various command line arguments. These can be passed by
implementing a ``driver_args`` fixture and returning a list of the desired
arguments. The following example specifies the log file path:

.. code-block:: python
import pytest
@pytest.fixture
def driver_args():
return ['--webdriver-logfile=phantomjs.log']
For a full list of supported command line arguments, run ``phantomjs --help``
in your terminal.

Safari
------

Expand Down
8 changes: 1 addition & 7 deletions pytest_selenium/drivers/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,11 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

import os
import sys
import configparser

from pytest_selenium.exceptions import MissingCloudCredentialError


if sys.version_info[0] == 2:
import ConfigParser as configparser
else:
import configparser


class Provider(object):
@property
def name(self):
Expand Down
19 changes: 0 additions & 19 deletions pytest_selenium/drivers/phantomjs.py

This file was deleted.

7 changes: 0 additions & 7 deletions pytest_selenium/pytest_selenium.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@
import argparse
import copy
from datetime import datetime
from distutils.version import LooseVersion
import os
import io
import logging

import pytest
from requests.structures import CaseInsensitiveDict
from selenium import __version__ as SELENIUM_VERSION
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.support.event_firing_webdriver import EventFiringWebDriver
Expand All @@ -37,11 +35,6 @@
}
)


# Selenium 4.0.0 deprecated phantom js.
if LooseVersion(SELENIUM_VERSION) < LooseVersion("4.0.0"):
SUPPORTED_DRIVERS["PhantomJS"] = webdriver.PhantomJS

try:
from appium import webdriver as appiumdriver

Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
url="https://github.com/pytest-dev/pytest-selenium",
packages=["pytest_selenium", "pytest_selenium.drivers"],
install_requires=[
"pytest>=3.6",
"pytest>=5.0.0",
"pytest-base-url",
"pytest-html>=1.14.0",
"pytest-variables>=1.5.0",
Expand All @@ -29,7 +29,6 @@
"firefox_driver = pytest_selenium.drivers.firefox",
"ie_driver = pytest_selenium.drivers.internet_explorer",
"remote_driver = pytest_selenium.drivers.remote",
"phantomjs_driver = pytest_selenium.drivers.phantomjs",
"safari_driver = pytest_selenium.drivers.safari",
"saucelabs_driver = pytest_selenium.drivers.saucelabs",
"testingbot_driver = pytest_selenium.drivers.testingbot",
Expand All @@ -40,6 +39,7 @@
extras_require={"appium": ["appium-python-client>=0.44"]},
license="Mozilla Public License 2.0 (MPL 2.0)",
keywords="py.test pytest selenium saucelabs browserstack webqa qa",
python_requires=">=3.6",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Framework :: Pytest",
Expand All @@ -52,8 +52,8 @@
"Topic :: Software Development :: Testing",
"Topic :: Utilities",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
],
)
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# and then run "tox" from this directory.

[tox]
envlist = py{27,36,37,py,py3}, docs, linting
envlist = py{36,37,38,py3}, docs, linting

[testenv]
passenv = PYTEST_ADDOPTS
Expand Down

0 comments on commit 6e355ce

Please sign in to comment.