Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
GregaVrbancic committed Apr 26, 2019
1 parent 5e57441 commit f5abee7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions NiaPy/tests/test_runner.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# encoding=utf8

from unittest import TestCase
from unittest import TestCase, skip

import NiaPy

Expand All @@ -25,15 +25,15 @@ def setUp(self):
self.algorithms = ['DifferentialEvolution', 'GreyWolfOptimizer', 'GeneticAlgorithm', 'ParticleSwarmAlgorithm', 'HybridBatAlgorithm', 'SelfAdaptiveDifferentialEvolution', 'CamelAlgorithm', 'BareBonesFireworksAlgorithm', 'MonkeyKingEvolutionV1', 'MonkeyKingEvolutionV2', 'MonkeyKingEvolutionV3', 'EvolutionStrategy1p1', 'EvolutionStrategyMp1', 'SineCosineAlgorithm', 'GlowwormSwarmOptimization', 'GlowwormSwarmOptimizationV1', 'GlowwormSwarmOptimizationV2', 'GlowwormSwarmOptimizationV3', 'KrillHerdV1', 'KrillHerdV2', 'KrillHerdV3', 'KrillHerdV4', 'KrillHerdV11', 'HarmonySearch', 'HarmonySearchV1', 'FireworksAlgorithm', 'EnhancedFireworksAlgorithm', 'DynamicFireworksAlgorithm', 'MultipleTrajectorySearch', 'MultipleTrajectorySearchV1', 'NelderMeadMethod', 'HillClimbAlgorithm', 'SimulatedAnnealing', 'GravitationalSearchAlgorithm', 'AnarchicSocietyOptimization']
self.benchmarks = ['griewank', MyBenchmark()]

@skip("Not working")
@skip("Not working")
def test_runner_works_fine(self):
self.assertTrue(
NiaPy.Runner(4, 500, 10, 2, useAlgorithms=self.algorithms, useBenchmarks=self.benchmarks).run())
NiaPy.Runner(4, 10, 2, useAlgorithms=self.algorithms, useBenchmarks=self.benchmarks).run())

@skip("Not working")
@skip("Not working")
def test_runner_bad_algorithm_throws_fine(self):
self.assertRaises(TypeError, lambda: NiaPy.Runner(4, 10, 3, 2, 'EvolutionStrategy', self.benchmarks).run())
self.assertRaises(TypeError, lambda: NiaPy.Runner(4, 10, 2, 'EvolutionStrategy', self.benchmarks).run())

@skip("Not working")
@skip("Not working")
def test_runner_bad_benchmark_throws_fine(self):
self.assertRaises(TypeError, lambda: NiaPy.Runner(4, 10, 3, 2, 'EvolutionStrategy1p1', 'TesterMan').run())
self.assertRaises(TypeError, lambda: NiaPy.Runner(4, 10, 2, 'EvolutionStrategy1p1', 'TesterMan').run())

0 comments on commit f5abee7

Please sign in to comment.