Skip to content

Commit 050556d

Browse files
updated the unit_testing exercise
1 parent d95f719 commit 050556d

8 files changed

Lines changed: 19 additions & 17 deletions

File tree

‎source/class_schedule/lesson03.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ Exercises:
2727
../exercises/slicing.rst
2828
../exercises/list_lab.rst
2929
../exercises/string_formatting.rst
30-
../exercises/mailroom-part1.rst
31-
../exercises/mailroom_tutorial.rst
30+
../exercises/mailroom/mailroom.rst
31+
../exercises/mailroom/mailroom_tutorial.rst
3232

3333
Optional
3434
--------

‎source/class_schedule/lesson04.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Exercises:
3838
../exercises/except_exercise.rst
3939
../exercises/unit_testing.rst
4040
../exercises/dict_lab.rst
41-
../exercises/mailroom-part2.rst
41+
../exercises/mailroom/mailroom_with_dicts.rst
4242
../exercises/trigrams/trigrams.rst
4343

4444

‎source/class_schedule/lesson05.rst‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,7 @@ Exercises:
2828
../exercises/exceptions_lab.rst
2929
../exercises/except_exercise.rst
3030
../exercises/comprehensions_lab.rst
31-
../exercises/mailroom-part3.rst
31+
../exercises/mailroom/mailroom_with_exceptions.rst
32+
../exercises/mailroom/mailroom_with_files.rst
33+
3234

‎source/class_schedule/lesson06.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Exercises:
3131
:maxdepth: 1
3232

3333
../exercises/args_kwargs_lab.rst
34-
../exercises/mailroom-part4.rst
34+
../exercises/mailroom/mailroom_with_tests.rst
3535

36-
**NOTE:** you will find that most introductions to unit testing with Python use the built in ``unittest`` module. However, it is a bit heavyweight, and requires some knowledge of OOP -- classes, etc. So we'll be using pytest in this class:
36+
**NOTE:** you will find that most introductions to unit testing with Python use the built in ``unittest`` module. However, it is a bit heavyweight, and requires some knowledge of OOP -- classes, etc. So we use pytest in this class:
3737
http://doc.pytest.org/en/latest/. But the principles of testing are the same.

‎source/class_schedule/lesson09.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ Exercises:
3939
.. toctree::
4040
:maxdepth: 1
4141

42-
../exercises/mailroom-oo.rst
42+
../exercises/mailroom/mailroom-oo.rst

‎source/exercises/unit_testing.rst‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,27 @@ at the command line:
2525
.. code-block:: bash
2626
2727
$ pytest
28-
============================= test session starts ==============================
29-
platform darwin -- Python 3.7.0, pytest-3.10.1, py-1.5.4, pluggy-0.7.1
30-
rootdir: /Users/Chris/temp/DrMartins, inifile:
31-
plugins: cov-2.6.0
28+
====================== test session starts ======================
29+
platform darwin -- Python 3.8.2, pytest-5.4.3, py-1.8.2, pluggy-0.13.1
30+
rootdir: /Users/chris.barker/Junk/junk
3231
collected 0 items
3332
34-
========================= no tests ran in 0.01 seconds =========================
33+
===================== no tests ran in 0.00s =====================
34+
3535
3636
If you already HAVE some tests -- you may see something different!
3737

3838

3939
Test Driven Development
4040
-----------------------
4141

42-
Download these files, and save them in your own students directory in the class repo:
42+
Download these files, or find them in the exercise repo:
4343

44-
:download:`test_walnut_party.py <../examples/testing/test_walnut_party.py>`
44+
:download:`test_walnut_party.py <unit_testing/test_walnut_party.py>`
4545

4646
and:
4747

48-
:download:`walnut_party.py <../examples/testing/walnut_party.py>`
48+
:download:`walnut_party.py <unit_testing/walnut_party.py>`
4949

5050
(This is the adapted from the codingbat site: http://codingbat.com/prob/p195669)
5151

@@ -59,7 +59,7 @@ You will get a LOT of test failures!
5959

6060
What you've done here is the first step in what is called:
6161

62-
**Test Driven Development**
62+
.. centered:: **Test Driven Development (TDD)**
6363

6464
A bunch of tests exist, but the code to make them pass does not yet exist.
6565

@@ -72,7 +72,7 @@ The tests all failed because currently ``walnut_party()`` looks like:
7272
def walnut_party(walnuts, is_weekend):
7373
pass
7474
75-
A totally do nothing function.
75+
A totally do nothing function -- of course the tests all fail!
7676

7777

7878
Making tests pass
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)