Skip to content

Commit

Permalink
removed nose nottest, since it creates import error. Added pytest mar…
Browse files Browse the repository at this point in the history
…kings that skip test for tests that fail or take too much time.
  • Loading branch information
Tessa van der Heiden authored and Tessa van der Heiden committed Sep 16, 2022
1 parent d84b8a9 commit 33202a7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions shgo/pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[pytest]
markers =
slow: mark test that take too much time.
10 changes: 5 additions & 5 deletions shgo/tests/test__shgo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import numpy as np
import pytest
from pytest import raises as assert_raises, warns
from nose.tools import nottest
from shgo import shgo
from shgo._shgo import SHGO

Expand Down Expand Up @@ -293,7 +292,7 @@ def g4(x):
expected_x=None
)

@nottest
@pytest.mark.skip
def run_test(test, args=(), test_atol=1e-5, n=100, iters=None,
callback=None, minimizer_kwargs=None, options=None,
sampling_method='sobol', workers=None):
Expand Down Expand Up @@ -554,7 +553,7 @@ def test_4_2_known_f_min(self):

#@pytest.mark.slow
#@pytest.mark.skip(reason="no way of currently testing this")
@nottest
@pytest.mark.skip
def test_4_3_known_f_min(self):
"""Test Global mode limiting local evaluations"""
options = { # Specify known function value
Expand All @@ -569,7 +568,7 @@ def test_4_3_known_f_min(self):
test_atol=1e-5, options=options,
sampling_method='sobol')

#@nottest
#@pytest.mark.skip
def test_4_4_known_f_min(self):
"""Test Global mode limiting local evaluations for 1D funcs"""
options = { # Specify known function value
Expand Down Expand Up @@ -680,7 +679,7 @@ def test_11_f_min_0(self):
np.testing.assert_equal(0, res.x[0])
np.testing.assert_equal(0, res.x[1])

@nottest
@pytest.mark.skip
def test_12_sobol_inf_cons(self):
"""Test to cover the case where f_lowest == 0"""
#TODO: This test doesn't cover anything new, it is unknown what the
Expand Down Expand Up @@ -731,6 +730,7 @@ def test_18_parallelization(self):
run_test(test1_1, n=30, workers=1) # Constrained
run_test(test_s, n=30, workers=1) # Unconstrained

@pytest.mark.skip
def test_19_constrained_args(self):
"""Test that constraints can be passed to arguments"""
def eggholder(x):
Expand Down

0 comments on commit 33202a7

Please sign in to comment.