-
Notifications
You must be signed in to change notification settings - Fork 35
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Due to breaking changes in pytest 7.0.0,
- https://docs.pytest.org/en/latest/changelog.html#breaking-changes
- fix: prevent approx from being used without a comparison pytest-dev/pytest#9061
tmp_path = PosixPath('/tmp/pytest-of-f_scout_ci/pytest-1503/test_to_csv0')
def test_to_csv(tmp_path):
"""Test to_csv"""
os.chdir(tmp_path)
vec = np.array([0, 0.5, 1, 2])
welltest_dpds.to_csv("mock.csv", [vec])
assert Path("mock.csv").exists()
lines = Path("mock.csv").read_text(encoding="utf8").splitlines()
assert len(lines) == 4
welltest_dpds.to_csv("mock.csv", [vec], ["vec"])
assert Path("mock.csv").exists()
lines = Path("mock.csv").read_text(encoding="utf8").splitlines()
assert len(lines) == 5
vecb = np.array([1, 0.5, 3, 100])
welltest_dpds.to_csv("mock.csv", [vec, vecb], ["vec", "vecb"])
assert Path("mock.csv").exists()
lines = Path("mock.csv").read_text(encoding="utf8").splitlines()
assert len(lines) == 5
dframe = pd.read_csv("mock.csv", skipinitialspace=True)
assert dframe["vec"].size == 4
> assert pytest.approx(dframe["vecb"].iloc[-1] == 100)
E AssertionError: approx() is not supported in a boolean context.
E Did you mean: `assert a == approx(b)`?
/tmp/jenkins-komodo-f_scout_ci/workspace/unit-tests/subscript/test-root/tests/test_welltest_dpds.py:268: AssertionError
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working