Skip to content

Commit f162521

Browse files
committed
Correct chapter number in timetable and shorten parts of the Python testing demo notes
1 parent 9787ace commit f162521

File tree

2 files changed

+4
-19
lines changed

2 files changed

+4
-19
lines changed

00_organization/course_intro_slides.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ td {
218218
| Date | Type | Chapter | Topic | Lecturer |
219219
| ---- | ---- | ------- |------ | -------- |
220220
| 08.01. |Lecture | 4 | Markup, Pandoc, website gener. | Benjamin |
221-
| 08.01. |Lecture | 6 | FLOSS, versioning, repo layouts, DOI, Zenodo, DaRUS | Benjamin |
221+
| 08.01. |Lecture | 4 | FLOSS, versioning, repo layouts, DOI, Zenodo, DaRUS | Benjamin |
222222
| 15.01. |Lecture | 5 | Intro testing, testing in Python | Ishaan |
223223
| 15.01. |Lab | 5 | Testing in Python | Ishaan |
224224
| 22.01. |Lecture | 5 | Automation, GitHub Actions, GitLab CI | Gerasimos|

05_testing_and_ci/python_testing_demo.md

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,7 @@ Example code is in [05_testing_and_ci/examples/python_testing](https://github.co
1515

1616
## pytest
1717

18-
- pytest is installed by:
19-
20-
```bash
21-
pip install -U pytest
22-
```
23-
18+
- pytest is installed using pip: `pip install pytest`.
2419
- All tests can be run using the command-line tool called `pytest`. Just type `pytest` in the working directory and hit ENTER.
2520
- If pytest is installed in some other way, you might need to run it like `python -m pytest`.
2621
- One test is expected to fail. Reading the error message we understand that the failure occurs because floating-point variable comparison is not handled correctly.
@@ -80,12 +75,7 @@ tests/
8075
- Base class `unittest.TestCase` is used to create a test suite.
8176
- Each test is now a function of a class which is derived from the class `unittest.TestCase`.
8277
- The same tests as for `pytest` are implemented using `unittest` in the file `test_operations_unittests.py`. The tests are functions of a class named `TestOperations` which tests our mathematical operations. The class `TestOperations` is derived from `unittest.TestCase`.
83-
- unittest can be run as a Python module:
84-
85-
```bash
86-
python -m unittest
87-
```
88-
78+
- unittest can be run as a Python module: `python -m unittest`.
8979
- unittest.TestCase offers functions like `assertEqual`, `assertAlmostEqual`, `assertTrue`, and more ([see unittest.TestCase documentation](https://docs.python.org/3/library/unittest.html#unittest.TestCase)) for use instead of the usual assertion statements. These statements ensure that test runner to accumulate all test results and generate a test report.
9080
- `unittest.main()` provides an option to run the tests from a command-line interface and also from a file.
9181
- `setUp` function is executed before all the tests. Similar a clean up function `tearDown` exists.
@@ -95,12 +85,7 @@ python -m unittest
9585

9686
## coverage
9787

98-
- Installing coverage using pip:
99-
100-
```bash
101-
pip install -U coverage
102-
```
103-
88+
- Installing coverage using pip: `pip install coverage`.
10489
- Testing frameworks can be run via coverage. Lets take our first example and run pytest via coverage:
10590

10691
```bash

0 commit comments

Comments
 (0)