- All of what was here: ch6/b/tasks_proj/tests
- tasks_proj/tox.ini added to demonstrate tox
- tests/pytest.ini contents moved to tasks_proj/tox.ini
- tests/unit/test_cli.py added to demonstrate mock
- src/tasks/api.py
- Fix problem where tasks.add() didn't raise an exception if
done
param passed in wasn't a bool.
- Fix problem where tasks.add() didn't raise an exception if
- src/tasks/tasksdb_pymongo.py
- Fix problem where tasks.add() was returning an object as an id instead of an integer
- add content to pytest.ini:
- declare markers (smoke, get)
- set some of my favorite options as defaults with addopts
- tasks.add() should raise an exception if
done
param passed in isn't a bool. It currently doesn't. - MongoDB still doesn't work.
- modify tests/conftest.py:
- remove
--nice
option - it's available as a plugin in ch5/pytest-nice if we want it.
- remove
- tasks.add() should raise an exception if
done
param passed in isn't a bool. It currently doesn't. - MongoDB still doesn't work.
- modify tests/conftest.py:
- add a
--nice
option to pytest for the: - test header
- turning failure into opportunity
- add a
- tasks.add() should raise an exception if
done
param passed in isn't a bool. It currently doesn't. - MongoDB still doesn't work.
- Maybe we should have been working on fixing bugs instead playing with nice options. Just saying.
- modify tests/conftest.py:
- add a test header
- turn failure into opportunity
- tasks.add() should raise an exception if
done
param passed in isn't a bool. It currently doesn't. - MongoDB still doesn't work.
- modify tests/conftest.py:
- put
tasks_db_session
back to just testing TinyDB. The fix for the MongoDB is in ch7/tasks_proj_v2, if you're curious. But for now, testing with TinyDB is sufficient.
- put
- tests/func/test_api_exceptions.py:
- add a couple more tests. One that demonstrates a failure.
- tasks.add() allows a
done
param to be a string. Shouldn't. - MongoDB still doesn't work.
- modify tests/conftest.py:
- parametrize
tasks_db_session
to test both TinyDB and MongoDB.
- parametrize
- Lots of tests fail.
- possibly due to some problem with task_id with the MongoDB version
- modify tests/conftest.py:
- Create a session scope fixture
tasks_db_session
that connects to db. - Have
tasks_db
fixture usetasks_db_session
and just clean out db between tests.
- Create a session scope fixture
- add tests/func/test_add_variety2.py
- demonstrate paramterized fixtures
- add tests/conftest.py with fixtures:
- tasks_just_a_few : 3 tasks in a tuple
- tasks_mult_per_owner : 9 tasks with 3 owners
- tasks_db : connection to db, using TinyDB
- db_with_3_tasks : db prefilled with 3 tasks
- db_with_multi_per_owner : db prefilled with 9 tasks
- modify to use fixtures:
- test_add.py
- test_add_variety.py
- test_api_exceptions.py
- test_unique_id.py
- remove tests/unit/test_task_fail.py
- it was just to demo failures
- remove tests/func/test_unique_id_1.py
- remove tests/func/test_unique_id_2.py
- remove tests/func/test_unique_id_3.py
- remove tests/func/test_unique_id_4.py
- add tests/func/test_unique_id.py
- just need one unique_id test.
- added tests/unit/test_Task.py
- a few tests to demonstrate running tests
- added tests/unit/test_Task_fail.py
- demonstrate test failure
- added tests/func/test_api_exceptions.py
- testing for expected exceptions
- added tests/func/test_add.py
- testing
tasks.add()
- demonstrate user defined markers
- testing
- added tests/func/test_unique_id_1.py
- initial tests for
tasks.unique_id()
.
- initial tests for
- added tests/func/test_unique_id_2.py
- demonstrate
@pytest.mark.skip()
.
- demonstrate
- added tests/func/test_unique_id_3.py :
- demonstrate
@pytest.mark.skipif()
.
- demonstrate
- added tests/func/test_unique_id_4.py
- demonstrate
@pytest.mark.xfail()
.
- demonstrate
- added tests/func/test_add_variety.py
- demonstrate
@pytest.mark.parametrize
on functions and classes.
- demonstrate
- Initial version.