Skip to content

Commit

Permalink
removed nose dependency in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fzumstein committed Aug 23, 2023
1 parent 9308228 commit 876ebbc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 45 deletions.
32 changes: 9 additions & 23 deletions tests/udfs/udf_tests.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import sys
from datetime import date, datetime

if sys.version_info >= (2, 7):
from nose.tools import assert_dict_equal

import xlwings as xw

try:
Expand Down Expand Up @@ -41,14 +37,6 @@ def series_equal(a, b):
pd = None


def dict_equal(a, b):
try:
assert_dict_equal(a, b)
except AssertionError:
return False
return True


# Defaults
@xw.func
def read_float(x):
Expand Down Expand Up @@ -176,19 +164,17 @@ def read_empty_as(x):
return x == [[1.0, "empty"], ["empty", 4.0]]


if sys.version_info >= (2, 7):
# assert_dict_equal isn't available on nose for PY 2.6
# Dicts
@xw.func
@xw.arg("x", dict)
def read_dict(x):
return x == {"a": 1.0, "b": "c"}

# Dicts
@xw.func
@xw.arg("x", dict)
def read_dict(x):
return dict_equal(x, {"a": 1.0, "b": "c"})

@xw.func
@xw.arg("x", dict, transpose=True)
def read_dict_transpose(x):
return dict_equal(x, {1.0: "c", "a": "b"})
@xw.func
@xw.arg("x", dict, transpose=True)
def read_dict_transpose(x):
return x == {1.0: "c", "a": "b"}


@xw.func
Expand Down
31 changes: 9 additions & 22 deletions tests/udfs/udf_tests_officejs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@
* categories aren't supported: replaced by namespaces
"""
import datetime as dt
import sys
from datetime import date, datetime

from nose.tools import assert_dict_equal

import xlwings as xw
from xlwings.pro import arg, func, ret

Expand Down Expand Up @@ -51,14 +48,6 @@ def series_equal(a, b):
pd = None


def dict_equal(a, b):
try:
assert_dict_equal(a, b)
except AssertionError:
return False
return True


# Defaults
@func
def read_float(x):
Expand Down Expand Up @@ -191,19 +180,17 @@ def read_empty_as(x):
return x == [[1, "empty"], ["empty", 4]]


if sys.version_info >= (2, 7):
# assert_dict_equal isn't available on nose for PY 2.6
# Dicts
@func
@arg("x", dict)
def read_dict(x):
return x == {"a": 1, "b": "c"}

# Dicts
@func
@arg("x", dict)
def read_dict(x):
return dict_equal(x, {"a": 1, "b": "c"})

@func
@arg("x", dict, transpose=True)
def read_dict_transpose(x):
return dict_equal(x, {1: "c", "a": "b"})
@func
@arg("x", dict, transpose=True)
def read_dict_transpose(x):
return x == {1: "c", "a": "b"}


@func
Expand Down

0 comments on commit 876ebbc

Please sign in to comment.