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 876ebbc commit 366b08d
Showing 1 changed file with 11 additions and 22 deletions.
33 changes: 11 additions & 22 deletions xlwingsjs/tests/udf_tests_officejs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""
TODO: why is this here and and under root tests folder?
Key differences with COM UDFs:
* respects ints (COM always returns floats)
* returns 0 for empty cells. To get None like in COM, you need to set the formula to: =""
Expand All @@ -8,11 +10,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 +50,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 +182,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 366b08d

Please sign in to comment.