Skip to content

Commit 089e26e

Browse files
committed
remove nose usage from testing.disabled
nose does not work for recent Python versions anymore. unittest.SkipTest is available for >=2.7 which is enough for supported versions.
1 parent 7f9543f commit 089e26e

File tree

3 files changed

+6
-18
lines changed

3 files changed

+6
-18
lines changed

pyproject.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ exclude = '''
3838
python_version = "3.9"
3939
warn_unused_configs = true
4040

41-
[[tool.mypy.overrides]]
42-
module = "nose.plugins.skip"
43-
ignore_missing_imports = true
44-
4541
[build-system]
4642
requires = ["setuptools>=64.0", "cython>=3"]
4743
build-backend = "setuptools.build_meta"

qcore/testing.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343
# make the output more concise.
4444
# __unittest = 1
4545

46-
4746
import functools
4847
import inspect
48+
from unittest.case import SkipTest
4949

5050
TEST_PREFIX = "test"
5151

@@ -100,12 +100,7 @@ def disabled(func_or_class):
100100
def decorate_func(func):
101101
@functools.wraps(func)
102102
def wrapper(*args, **kwargs):
103-
try:
104-
from nose.plugins.skip import SkipTest
105-
except ImportError:
106-
return None # do nothing, the test will show up as passed
107-
else:
108-
raise SkipTest
103+
raise SkipTest
109104

110105
return wrapper
111106

qcore/tests/test_testing.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from unittest.case import SkipTest
16+
1517
from qcore.asserts import assert_eq, assert_is, AssertRaises
1618
from qcore.testing import (
1719
Anything,
@@ -48,13 +50,8 @@ def test_GreaterEq():
4850

4951

5052
def _check_disabled(fn):
51-
try:
52-
from nose.plugins.skip import SkipTest
53-
except ImportError:
54-
assert_is(None, fn())
55-
else:
56-
with AssertRaises(SkipTest):
57-
fn()
53+
with AssertRaises(SkipTest):
54+
fn()
5855

5956

6057
def test_disabled():

0 commit comments

Comments
 (0)