Skip to content

Commit

Permalink
feat: add support for python 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
rgonalo committed Dec 14, 2020
1 parent 41aeab1 commit 30e29c3
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Expand Up @@ -21,6 +21,10 @@ matrix:
env: TOX_ENV=py38
dist: xenial
sudo: false
- python: 3.9
env: TOX_ENV=py39
dist: focal
sudo: false
install:
- pip install tox
- pip install setuptools
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.rst
Expand Up @@ -6,6 +6,7 @@ v1.8.2

*Release date: In development*

- Add support for python 3.9
- Add *get_driver_name* method to driver utils class
- Add doc about how to configure Firefox device mode

Expand Down
3 changes: 2 additions & 1 deletion requirements_dev.txt
@@ -1,7 +1,8 @@
Sphinx==1.5.1
behave==1.2.5
lettuce==0.2.23
pytest==2.9.2
pytest==2.9.2 ; python_version < '3.9'
pytest==6.1.2 ; python_version >= '3.9'
coverage==4.3.1
mock==2.0.0
requests-mock==1.2.0
Expand Down
1 change: 1 addition & 0 deletions setup.py
Expand Up @@ -70,6 +70,7 @@ def get_long_description():
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Software Development :: Quality Assurance',
'Topic :: Software Development :: Testing',
Expand Down
19 changes: 13 additions & 6 deletions toolium/test/test_visual_test.py
Expand Up @@ -16,12 +16,12 @@
limitations under the License.
"""

import mock
import os
import pkg_resources
import pytest
import re
import shutil

import mock
import pytest
from PIL import Image
from needle.engines.imagemagick_engine import Engine as MagickEngine
from needle.engines.perceptualdiff_engine import Engine as PerceptualEngine
Expand Down Expand Up @@ -151,8 +151,11 @@ def test_compare_files_diff_fail(driver_wrapper):
def test_compare_files_size(driver_wrapper):
visual = VisualTest(driver_wrapper)
message = visual.compare_files('report_name', file_v1, file_small, 0)
# PIL returns an empty error, but PyTest modifies AssertionError
assert 'assert (1680, 388) == (1246, 388)' in message
if pkg_resources.get_distribution('pytest').version == '2.9.2':
# PIL returns an empty error, but PyTest modifies AssertionError
assert message.startswith('assert (1680, 388) == (1246, 388)')
else:
assert message == 'Image dimensions do not match'


def test_compare_files_size_fail(driver_wrapper):
Expand All @@ -162,7 +165,11 @@ def test_compare_files_size_fail(driver_wrapper):

with pytest.raises(AssertionError) as exc:
visual.compare_files('report_name', file_v1, file_small, 0)
assert str(exc.value).startswith('assert (1680, 388) == (1246, 388)')
if pkg_resources.get_distribution('pytest').version == '2.9.2':
# PIL returns an empty error, but PyTest modifies AssertionError
assert str(exc.value).startswith('assert (1680, 388) == (1246, 388)')
else:
assert str(exc.value) == ''


def test_get_img_element(driver_wrapper):
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
@@ -1,5 +1,5 @@
[tox]
envlist = py27, py35, py36, py37, py38
envlist = py27, py35, py36, py37, py38, py39

[testenv]
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
Expand Down

0 comments on commit 30e29c3

Please sign in to comment.