Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ exclude = '''
python_version = "3.9"
warn_unused_configs = true

[[tool.mypy.overrides]]
module = "nose.plugins.skip"
ignore_missing_imports = true

[build-system]
requires = ["setuptools>=64.0", "cython>=3"]
build-backend = "setuptools.build_meta"
Expand Down
9 changes: 2 additions & 7 deletions qcore/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
# make the output more concise.
# __unittest = 1


import functools
import inspect
from unittest.case import SkipTest

TEST_PREFIX = "test"

Expand Down Expand Up @@ -100,12 +100,7 @@ def disabled(func_or_class):
def decorate_func(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
try:
from nose.plugins.skip import SkipTest
except ImportError:
return None # do nothing, the test will show up as passed
else:
raise SkipTest
raise SkipTest

return wrapper

Expand Down
11 changes: 4 additions & 7 deletions qcore/tests/test_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from unittest.case import SkipTest

from qcore.asserts import assert_eq, assert_is, AssertRaises
from qcore.testing import (
Anything,
Expand Down Expand Up @@ -48,13 +50,8 @@ def test_GreaterEq():


def _check_disabled(fn):
try:
from nose.plugins.skip import SkipTest
except ImportError:
assert_is(None, fn())
else:
with AssertRaises(SkipTest):
fn()
with AssertRaises(SkipTest):
fn()


def test_disabled():
Expand Down
Loading