Skip to content

Commit

Permalink
Merge pull request #326 from aleju/fix_tests
Browse files Browse the repository at this point in the history
Enforce pytest <4.6.0
  • Loading branch information
aleju authored Jun 2, 2019
2 parents 85fb0cf + e99f42d commit a5f6966
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 7 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ install:
# - virtualenv venv
# - . venv/bin/activate
- pip install -r requirements.txt
- pip install -r test/requirements.txt
# Added --upgrade, because at least pytest already came from some other
# install command and so version was never checked
- pip install --upgrade -r test/requirements.txt
- pip install coverage codecov pytest-cov codacy-coverage
- pip install .

Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
`True` and `False` values.
* Added augmenter `Canny`, which applies canny edge detection with alpha
blending and random coloring to images.
* Renamed `imgaug/external/poly_point_isect.py` to `imgaug/external/poly_point_isect_py3.py.bak`.
The file is in the library only for completeness and contains python3 syntax.
`poly_point_isect_py2py3.py` is actually used.

## Fixes

Expand Down
13 changes: 8 additions & 5 deletions imgaug/augmenters/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -3255,16 +3255,19 @@ def OneOf(children, name=None, deterministic=False, random_state=None):
Examples
--------
>>> imgs = [np.ones((10, 10))]
>>> import imgaug.augmenters as iaa
>>> images = [np.ones((10, 10), dtype=np.uint8)]
>>> seq = iaa.OneOf([
>>> iaa.Fliplr(1.0),
>>> iaa.Flipud(1.0)
>>> ])
>>> imgs_aug = seq.augment_images(imgs)
>>> imgs_aug = seq.augment_images(images)
flips each image either horizontally or vertically.
Flips each image either horizontally or vertically.
>>> import imgaug.augmenters as iaa
>>> images = [np.ones((10, 10), dtype=np.uint8)]
>>> seq = iaa.OneOf([
>>> iaa.Fliplr(1.0),
>>> iaa.Sequential([
Expand All @@ -3274,9 +3277,9 @@ def OneOf(children, name=None, deterministic=False, random_state=None):
>>> ]),
>>> iaa.Noop()
>>> ])
>>> imgs_aug = seq.augment_images(imgs)
>>> imgs_aug = seq.augment_images(images)
either flips each image horizontally, or adds blur+dropout+noise or does
Either flips each image horizontally, or adds blur+dropout+noise or does
nothing.
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
#############################################################################
# This file uses python3 syntax. The actually used version of this library is
# in "(...)_py2py3.py". This (original) file is added for completeness.
# To avoid fatal errors related to the test environment in python2.7, it
# ends in ".py.bak", so that the file is always ignored.
# (There are probably more elegant ways to achieve this.)
#############################################################################


# BentleyOttmann sweep-line implementation
# (for finding all intersections in a set of line segments)

Expand Down
3 changes: 2 additions & 1 deletion test/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pytest>=3.0.5
# 4.6.0 currently causes crashes, see https://github.com/pytest-dev/pytest/issues/5358
pytest>=3.0.5,<4.6.0
mock; python_version < '3.3' # unittest.mock does not exist in older versions
unittest2; python_version < '3.4' # in 3.4, self.subTest was added
xdoctest >= 0.7.2

0 comments on commit a5f6966

Please sign in to comment.