Skip to content

Commit

Permalink
ordering code and comment travis
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestoarbitrio committed Sep 28, 2020
1 parent 08c2f59 commit a76327f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -61,7 +61,7 @@ before_script:
# command to run tests
script:
- flake8 .
- pytest --ignore=tests/benchmarks --cov=histolab
- pytest --ignore=tests/benchmarks --cov=histolab # benchmarks must be in a separate pipeline - not on travis

after_success:
- coveralls
Expand Down
12 changes: 7 additions & 5 deletions tests/benchmarks/test_benchmarks.py
@@ -1,13 +1,15 @@
# encoding: utf-8

import numpy as np
from histolab.filters.util import mask_percent, mask_difference
from histolab.filters.util import mask_difference, mask_percent


class TestDescribeBenchmarksFilterUnit:
def test_mask_percent(self, benchmark):
mask_array = np.random.choice(a=[False, True], size=(10000, 4000))
benchmark.pedantic(mask_percent, args=[mask_array], iterations=100, rounds=50)

def test_mask_difference(self, benchmark):
minuend = np.random.choice(a=[False, True], size=(5000, 4000))
subtrahend = np.random.choice(a=[False, True], size=(5000, 4000))
benchmark.pedantic(mask_difference, args=[minuend, subtrahend], rounds=100)

def test_mask_percent(self, benchmark):
mask_array = np.random.choice(a=[False, True], size=(10000, 4000))
benchmark.pedantic(mask_percent, args=[mask_array], iterations=100, rounds=50)

0 comments on commit a76327f

Please sign in to comment.