From b8a61be0809f9d52b0a28ba43330cf6d0fa5eb56 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Mon, 13 Mar 2023 15:16:30 +0530 Subject: [PATCH] test: fix hypothesis tests (#34416) --- erpnext/stock/tests/test_valuation.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/erpnext/stock/tests/test_valuation.py b/erpnext/stock/tests/test_valuation.py index e60c1caac3..05f153b4a0 100644 --- a/erpnext/stock/tests/test_valuation.py +++ b/erpnext/stock/tests/test_valuation.py @@ -132,7 +132,7 @@ class TestFIFOValuation(unittest.TestCase): total_qty = 0 for qty, rate in stock_queue: - if qty == 0: + if round_off_if_near_zero(qty) == 0: continue if qty > 0: self.queue.add_stock(qty, rate) @@ -154,7 +154,7 @@ class TestFIFOValuation(unittest.TestCase): for qty, rate in stock_queue: # don't allow negative stock - if qty == 0 or total_qty + qty < 0 or abs(qty) < 0.1: + if round_off_if_near_zero(qty) == 0 or total_qty + qty < 0 or abs(qty) < 0.1: continue if qty > 0: self.queue.add_stock(qty, rate) @@ -179,7 +179,7 @@ class TestFIFOValuation(unittest.TestCase): for qty, rate in stock_queue: # don't allow negative stock - if qty == 0 or total_qty + qty < 0 or abs(qty) < 0.1: + if round_off_if_near_zero(qty) == 0 or total_qty + qty < 0 or abs(qty) < 0.1: continue if qty > 0: self.queue.add_stock(qty, rate) @@ -282,7 +282,7 @@ class TestLIFOValuation(unittest.TestCase): total_qty = 0 for qty, rate in stock_stack: - if qty == 0: + if round_off_if_near_zero(qty) == 0: continue if qty > 0: self.stack.add_stock(qty, rate) @@ -304,7 +304,7 @@ class TestLIFOValuation(unittest.TestCase): for qty, rate in stock_stack: # don't allow negative stock - if qty == 0 or total_qty + qty < 0 or abs(qty) < 0.1: + if round_off_if_near_zero(qty) == 0 or total_qty + qty < 0 or abs(qty) < 0.1: continue if qty > 0: self.stack.add_stock(qty, rate)