Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ================= test session starts =================
- platform linux -- Python 3.8.10, pytest-5.3.2, py-1.10.0, pluggy-0.13.1 -- /home/fill/Study/2 sprint/hw_python_oop/venv/bin/python
- rootdir: /home/fill/Study/2 sprint/hw_python_oop, inifile: pytest.ini, testpaths: tests/
- collected 20 items
- tests/test_homework.py::TestRecord::test_init[kwargs0] PASSED [ 5%]
- tests/test_homework.py::TestRecord::test_init[kwargs1] PASSED [ 10%]
- tests/test_homework.py::TestCalculator::test_init PASSED [ 15%]
- tests/test_homework.py::TestCalculator::test_add_record PASSED [ 20%]
- tests/test_homework.py::TestCalculator::test_get_today_stats PASSED [ 25%]
- tests/test_homework.py::TestCalculator::test_get_week_stats FAILED [ 30%]
- tests/test_homework.py::TestCalculator::test_get_calories_remained PASSED [ 35%]
- tests/test_homework.py::TestCalculator::test_get_today_cash_remained PASSED [ 40%]
- tests/test_homework.py::TestCaloriesCalculator::test_init PASSED [ 45%]
- tests/test_homework.py::TestCaloriesCalculator::test_get_calories_remained PASSED [ 50%]
- tests/test_homework.py::TestCashCalculator::test_init FAILED [ 55%]
- tests/test_homework.py::TestCashCalculator::test_get_today_cash_remained[0-usd] FAILED [ 60%]
- tests/test_homework.py::TestCashCalculator::test_get_today_cash_remained[0-eur] FAILED [ 65%]
- tests/test_homework.py::TestCashCalculator::test_get_today_cash_remained[0-rub] FAILED [ 70%]
- tests/test_homework.py::TestCashCalculator::test_get_today_cash_remained[1-usd] FAILED [ 75%]
- tests/test_homework.py::TestCashCalculator::test_get_today_cash_remained[1-eur] FAILED [ 80%]
- tests/test_homework.py::TestCashCalculator::test_get_today_cash_remained[1-rub] FAILED [ 85%]
- tests/test_homework.py::TestCashCalculator::test_get_today_cash_remained[-1-usd] FAILED [ 90%]
- tests/test_homework.py::TestCashCalculator::test_get_today_cash_remained[-1-eur] FAILED [ 95%]
- tests/test_homework.py::TestCashCalculator::test_get_today_cash_remained[-1-rub] FAILED [100%]
- ====================== FAILURES =======================
- _________ TestCalculator.test_get_week_stats __________
- self = <test_homework.TestCalculator object at 0x7feb58b77520>
- init_limit = 2500
- data_records = ([<homework.Record object at 0x7feb58b3f8e0>, <homework.Record object at 0x7feb58b3fc10>, <homework.Record object at 0...feb58b3fd90>, <homework.Record object at 0x7feb58b3fbb0>, <homework.Record object at 0x7feb58b3fb50>, ...], 1350, 2400)
- msg_err = <function msg_err.<locals>._msg_err at 0x7feb58b72f70>
- def test_get_week_stats(self, init_limit, data_records, msg_err):
- result = homework.Calculator(init_limit)
- records, today, week = data_records
- for record in records:
- result.add_record(record)
- assert hasattr(result, 'get_week_stats'), msg_err('add_method', 'get_week_stats', 'Calculator')
- > assert result.get_week_stats() == week, msg_err('wrong_method', 'get_week_stats', 'Calculator')
- E AssertionError: Проверьте правильность работы метода `get_week_stats()` у класса `Calculator`
- E assert 'За неделю с 2021-07-04 по 2021-07-10 было потрачено: 2400' == 2400
- E -'За неделю с 2021-07-04 по 2021-07-10 было потрачено: 2400'
- E +2400
- tests/test_homework.py:73: AssertionError
- ____________ TestCashCalculator.test_init _____________
- self = <test_homework.TestCashCalculator object at 0x7feb58b26b80>
- init_limit = 2500
- msg_err = <function msg_err.<locals>._msg_err at 0x7feb58b72ca0>
- def test_init(self, init_limit, msg_err):
- assert hasattr(homework, 'CashCalculator'), (
- msg_err('add_class', 'CashCalculator', child=True, parent_name='Calculator')
- )
- > result = homework.CashCalculator(init_limit)
- E TypeError: __init__() takes 1 positional argument but 2 were given
- tests/test_homework.py:136: TypeError
- _ TestCashCalculator.test_get_today_cash_remained[0-usd] _
- self = <test_homework.TestCashCalculator object at 0x7feb58b3fac0>
- init_limit = 2500
- data_records = ([<homework.Record object at 0x7feb58b263a0>, <homework.Record object at 0x7feb58b3fca0>, <homework.Record object at 0...7feb58b26340>, <homework.Record object at 0x7feb58b260a0>, <homework.Record object at 0x7feb58b3fa30>, ...], 900, 1650)
- amount = 0, currency = 'usd'
- today_cash_remained = <function today_cash_remained.<locals>._today_cash_remained at 0x7feb58b72c10>
- msg_err = <function msg_err.<locals>._msg_err at 0x7feb58b72f70>
- monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7feb58b26250>
- @pytest.mark.parametrize("amount,currency", [
- (0, 'usd'), (0, 'eur'), (0, 'rub'),
- (1, 'usd'), (1, 'eur'), (1, 'rub'),
- (-1, 'usd'), (-1, 'eur'), (-1, 'rub')
- ])
- def test_get_today_cash_remained(self, init_limit, data_records, amount, currency, today_cash_remained, msg_err,
- monkeypatch):
- > result = homework.CashCalculator(init_limit)
- E TypeError: __init__() takes 1 positional argument but 2 were given
- tests/test_homework.py:157: TypeError
- _ TestCashCalculator.test_get_today_cash_remained[0-eur] _
- self = <test_homework.TestCashCalculator object at 0x7feb58a9c610>
- init_limit = 2500
- data_records = ([<homework.Record object at 0x7feb58a9ce50>, <homework.Record object at 0x7feb58a9c6a0>, <homework.Record object at 0...feb58a9c370>, <homework.Record object at 0x7feb58a9cac0>, <homework.Record object at 0x7feb58a98a00>, ...], 1350, 2850)
- amount = 0, currency = 'eur'
- today_cash_remained = <function today_cash_remained.<locals>._today_cash_remained at 0x7feb58a71160>
- msg_err = <function msg_err.<locals>._msg_err at 0x7feb58a711f0>
- monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7feb58a98d00>
- @pytest.mark.parametrize("amount,currency", [
- (0, 'usd'), (0, 'eur'), (0, 'rub'),
- (1, 'usd'), (1, 'eur'), (1, 'rub'),
- (-1, 'usd'), (-1, 'eur'), (-1, 'rub')
- ])
- def test_get_today_cash_remained(self, init_limit, data_records, amount, currency, today_cash_remained, msg_err,
- monkeypatch):
- > result = homework.CashCalculator(init_limit)
- E TypeError: __init__() takes 1 positional argument but 2 were given
- tests/test_homework.py:157: TypeError
- _ TestCashCalculator.test_get_today_cash_remained[0-rub] _
- self = <test_homework.TestCashCalculator object at 0x7feb58aa79d0>
- init_limit = 2500
- data_records = ([<homework.Record object at 0x7feb58aa73d0>, <homework.Record object at 0x7feb58aa7e80>, <homework.Record object at 0...feb58aa7a00>, <homework.Record object at 0x7feb58aa7d90>, <homework.Record object at 0x7feb58a988b0>, ...], 1500, 3000)
- amount = 0, currency = 'rub'
- today_cash_remained = <function today_cash_remained.<locals>._today_cash_remained at 0x7feb58a71430>
- msg_err = <function msg_err.<locals>._msg_err at 0x7feb58a714c0>
- monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7feb58a98fd0>
- @pytest.mark.parametrize("amount,currency", [
- (0, 'usd'), (0, 'eur'), (0, 'rub'),
- (1, 'usd'), (1, 'eur'), (1, 'rub'),
- (-1, 'usd'), (-1, 'eur'), (-1, 'rub')
- ])
- def test_get_today_cash_remained(self, init_limit, data_records, amount, currency, today_cash_remained, msg_err,
- monkeypatch):
- > result = homework.CashCalculator(init_limit)
- E TypeError: __init__() takes 1 positional argument but 2 were given
- tests/test_homework.py:157: TypeError
- _ TestCashCalculator.test_get_today_cash_remained[1-usd] _
- self = <test_homework.TestCashCalculator object at 0x7feb58aa9670>
- init_limit = 2500
- data_records = ([<homework.Record object at 0x7feb58aa97f0>, <homework.Record object at 0x7feb58ab0760>, <homework.Record object at 0...feb58aa9220>, <homework.Record object at 0x7feb58aa9fd0>, <homework.Record object at 0x7feb58ab07c0>, ...], 1350, 2550)
- amount = 1, currency = 'usd'
- today_cash_remained = <function today_cash_remained.<locals>._today_cash_remained at 0x7feb58a71790>
- msg_err = <function msg_err.<locals>._msg_err at 0x7feb58a71820>
- monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7feb58ab0a60>
- @pytest.mark.parametrize("amount,currency", [
- (0, 'usd'), (0, 'eur'), (0, 'rub'),
- (1, 'usd'), (1, 'eur'), (1, 'rub'),
- (-1, 'usd'), (-1, 'eur'), (-1, 'rub')
- ])
- def test_get_today_cash_remained(self, init_limit, data_records, amount, currency, today_cash_remained, msg_err,
- monkeypatch):
- > result = homework.CashCalculator(init_limit)
- E TypeError: __init__() takes 1 positional argument but 2 were given
- tests/test_homework.py:157: TypeError
- _ TestCashCalculator.test_get_today_cash_remained[1-eur] _
- self = <test_homework.TestCashCalculator object at 0x7feb58a876a0>
- init_limit = 2500
- data_records = ([<homework.Record object at 0x7feb58a9c550>, <homework.Record object at 0x7feb58a87100>, <homework.Record object at 0...feb58a9ca60>, <homework.Record object at 0x7feb58a87b50>, <homework.Record object at 0x7feb58a87e20>, ...], 1350, 2700)
- amount = 1, currency = 'eur'
- today_cash_remained = <function today_cash_remained.<locals>._today_cash_remained at 0x7feb58a71b80>
- msg_err = <function msg_err.<locals>._msg_err at 0x7feb58a71ca0>
- monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7feb58a9cac0>
- @pytest.mark.parametrize("amount,currency", [
- (0, 'usd'), (0, 'eur'), (0, 'rub'),
- (1, 'usd'), (1, 'eur'), (1, 'rub'),
- (-1, 'usd'), (-1, 'eur'), (-1, 'rub')
- ])
- def test_get_today_cash_remained(self, init_limit, data_records, amount, currency, today_cash_remained, msg_err,
- monkeypatch):
- > result = homework.CashCalculator(init_limit)
- E TypeError: __init__() takes 1 positional argument but 2 were given
- tests/test_homework.py:157: TypeError
- _ TestCashCalculator.test_get_today_cash_remained[1-rub] _
- self = <test_homework.TestCashCalculator object at 0x7feb58b3fe20>
- init_limit = 2500
- data_records = ([<homework.Record object at 0x7feb58b3fdf0>, <homework.Record object at 0x7feb58a98cd0>, <homework.Record object at 0...feb58b8f850>, <homework.Record object at 0x7feb58b3fd90>, <homework.Record object at 0x7feb58a987f0>, ...], 1050, 2400)
- amount = 1, currency = 'rub'
- today_cash_remained = <function today_cash_remained.<locals>._today_cash_remained at 0x7feb58a719d0>
- msg_err = <function msg_err.<locals>._msg_err at 0x7feb58a71f70>
- monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7feb58a98af0>
- @pytest.mark.parametrize("amount,currency", [
- (0, 'usd'), (0, 'eur'), (0, 'rub'),
- (1, 'usd'), (1, 'eur'), (1, 'rub'),
- (-1, 'usd'), (-1, 'eur'), (-1, 'rub')
- ])
- def test_get_today_cash_remained(self, init_limit, data_records, amount, currency, today_cash_remained, msg_err,
- monkeypatch):
- > result = homework.CashCalculator(init_limit)
- E TypeError: __init__() takes 1 positional argument but 2 were given
- tests/test_homework.py:157: TypeError
- _ TestCashCalculator.test_get_today_cash_remained[-1-usd] _
- self = <test_homework.TestCashCalculator object at 0x7feb58ab0a00>
- init_limit = 2500
- data_records = ([<homework.Record object at 0x7feb58ab0fa0>, <homework.Record object at 0x7feb58aac4f0>, <homework.Record object at 0...feb58ab0d00>, <homework.Record object at 0x7feb58ab0490>, <homework.Record object at 0x7feb58ab0580>, ...], 1350, 2850)
- amount = -1, currency = 'usd'
- today_cash_remained = <function today_cash_remained.<locals>._today_cash_remained at 0x7feb58a71dc0>
- msg_err = <function msg_err.<locals>._msg_err at 0x7feb58a711f0>
- monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7feb58aace50>
- @pytest.mark.parametrize("amount,currency", [
- (0, 'usd'), (0, 'eur'), (0, 'rub'),
- (1, 'usd'), (1, 'eur'), (1, 'rub'),
- (-1, 'usd'), (-1, 'eur'), (-1, 'rub')
- ])
- def test_get_today_cash_remained(self, init_limit, data_records, amount, currency, today_cash_remained, msg_err,
- monkeypatch):
- > result = homework.CashCalculator(init_limit)
- E TypeError: __init__() takes 1 positional argument but 2 were given
- tests/test_homework.py:157: TypeError
- _ TestCashCalculator.test_get_today_cash_remained[-1-eur] _
- self = <test_homework.TestCashCalculator object at 0x7feb58a9c310>
- init_limit = 2500
- data_records = ([<homework.Record object at 0x7feb58ac38b0>, <homework.Record object at 0x7feb58ac3850>, <homework.Record object at 0...feb58a9c2e0>, <homework.Record object at 0x7feb58a9c160>, <homework.Record object at 0x7feb58a9cd30>, ...], 1350, 2100)
- amount = -1, currency = 'eur'
- today_cash_remained = <function today_cash_remained.<locals>._today_cash_remained at 0x7feb58b64ee0>
- msg_err = <function msg_err.<locals>._msg_err at 0x7feb58b64f70>
- monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7feb58ac3520>
- @pytest.mark.parametrize("amount,currency", [
- (0, 'usd'), (0, 'eur'), (0, 'rub'),
- (1, 'usd'), (1, 'eur'), (1, 'rub'),
- (-1, 'usd'), (-1, 'eur'), (-1, 'rub')
- ])
- def test_get_today_cash_remained(self, init_limit, data_records, amount, currency, today_cash_remained, msg_err,
- monkeypatch):
- > result = homework.CashCalculator(init_limit)
- E TypeError: __init__() takes 1 positional argument but 2 were given
- tests/test_homework.py:157: TypeError
- _ TestCashCalculator.test_get_today_cash_remained[-1-rub] _
- self = <test_homework.TestCashCalculator object at 0x7feb58ab9580>
- init_limit = 2500
- data_records = ([<homework.Record object at 0x7feb58ab9520>, <homework.Record object at 0x7feb58ab9ee0>, <homework.Record object at 0...feb58ab9be0>, <homework.Record object at 0x7feb58ab77c0>, <homework.Record object at 0x7feb58ab7700>, ...], 1050, 2250)
- amount = -1, currency = 'rub'
- today_cash_remained = <function today_cash_remained.<locals>._today_cash_remained at 0x7feb58a710d0>
- msg_err = <function msg_err.<locals>._msg_err at 0x7feb58a71280>
- monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7feb58ab7640>
- @pytest.mark.parametrize("amount,currency", [
- (0, 'usd'), (0, 'eur'), (0, 'rub'),
- (1, 'usd'), (1, 'eur'), (1, 'rub'),
- (-1, 'usd'), (-1, 'eur'), (-1, 'rub')
- ])
- def test_get_today_cash_remained(self, init_limit, data_records, amount, currency, today_cash_remained, msg_err,
- monkeypatch):
- > result = homework.CashCalculator(init_limit)
- E TypeError: __init__() takes 1 positional argument but 2 were given
- tests/test_homework.py:157: TypeError
- ============ 11 failed, 9 passed in 0.23s =============
Advertisement
Add Comment
Please, Sign In to add comment