Skip to content

Commit 2e630da

Browse files
committed
update testing/docs
1 parent cfb40a8 commit 2e630da

File tree

4 files changed

+29
-20
lines changed

4 files changed

+29
-20
lines changed

modules/documentation/overview.qmd

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ Don't document the program; program the document.
1010
:::
1111

1212
# Documentation
13-
Documenting all software is important, but just like testing, selecting the appropriate depends on the type of software
14-
and audience. For example, a simple script for producing a figure for a report will be documented very differently from
15-
an open-source library used by 1000s of people. Its not a coincidence that some of the most popular python packages are
16-
also the best documented. However, its not the *volume* of documentation that counts, but *quality*.
17-
18-
Types of documentation include code comments, docstrings, tutorials, how tos, quickstarts, references, etc. Each one
19-
has its place, and we will touch discuss them.
13+
Documenting all software is important, but just like testing, selecting the appropriate level and strategy
14+
depends on the type of software its audience. For example, a simple script for producing a figure for a
15+
report will be documented very differently from a popular open-source library. It's not a coincidence
16+
that some of the most popular python packages are also the best documented.
17+
However, it's not the *volume* of documentation that counts, but *quality*.
18+
19+
Types of documentation include code comments, docstrings, readmes, tutorials, how tos, quickstarts, references, etc.
20+
Each one has its place.
2021

2122
# Objectives
2223

modules/documentation/slides.qmd

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@ footer: \
2121

2222

2323
# What is it?
24-
<br>
2524

2625
Documentation is:
2726

2827
:::{.incremental}
2928
- User's manual
3029
- Blueprints
31-
- Promotional material
30+
- Advertisements
3231
- Sticky notes
3332
- Textbook
3433
- Prose
@@ -44,7 +43,7 @@ Documentation is:
4443
- Code comments (in-line, block)
4544
- Docstrings
4645
- Readme
47-
- Project Documentation
46+
- Project documentation
4847
:::
4948

5049

@@ -72,7 +71,7 @@ Use sparingly. Explain why, not what.
7271
<br>
7372

7473
```python
75-
extent = width + 1 # Add a bit to width
74+
extent = width + 1 # add one to width
7675
```
7776

7877

@@ -343,9 +342,9 @@ pytest --doctest-modules
343342
:::{.incremental}
344343
- Use a spell checker
345344
- Use complete sentences
346-
- Try to be empathetic
345+
- Try to be empathic, try to be a friend
347346
- It's fine if the docstring is longer than the code
348-
- Typehints are good too, don't be redundant.
347+
- Typehints are good too, don't be redundant
349348
:::
350349

351350

@@ -371,11 +370,14 @@ def my_func(thing_a, thing_b):
371370

372371
Your project's elevator pitch / note in a bottle
373372

373+
:::{.fragment}
374+
374375
- Short
375376
- Show code snippets
376377
- Describe basic functionality
377378
- A prospective user knows within 2 minutes if the library might solve their problem
378379

380+
:::
379381

380382

381383
# Markdown/reST

modules/testing/overview.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Here we simply try to highlight some of the main ideas and provide the basics of
4545

4646
In this module, we will cover:
4747

48-
1. Prevalent testing taxonomies and common types of testing
48+
1. Software testing approaches and domains
4949
2. Basics of the pytest framework
5050

5151
# Reading

modules/testing/slides.qmd

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -523,14 +523,14 @@ import matplotlib.pyplot as plt
523523
import numpy as np
524524
525525
with plt.xkcd():
526-
x = np.arange(1000)
526+
x = np.arange(100)
527527
528-
y = np.sqrt(x)
528+
y = np.log10(x)
529529
530530
plt.plot(x, y)
531531
532-
plt.xlabel("Time")
533-
plt.ylabel("Benefit")
532+
plt.xlabel("Testing Efforts")
533+
plt.ylabel("Quality Improvements")
534534
plt.xticks([])
535535
plt.yticks([])
536536
plt.show()
@@ -876,7 +876,7 @@ def test_data_2(data):
876876

877877
# Pytest Marks
878878

879-
```{.python code-line-numbers="1||3-4|7-8|11-12"}
879+
```{.python code-line-numbers="1||3-4|7-8|11-12|15-16"}
880880
import pytest
881881
882882
@pytest.mark.slow
@@ -887,6 +887,10 @@ def test_make_new_friends():
887887
def test_gaze_into_the_abyss():
888888
...
889889
890+
@pytest.mark.skipif(on_windows, reason="windows sucks")
891+
def test_do_useful_things():
892+
...
893+
890894
@pytest.mark.xfail
891895
def test_impress_my_father():
892896
...
@@ -896,6 +900,8 @@ def test_impress_my_father():
896900

897901
# Pytest Marks
898902

903+
<br>
904+
899905
```python
900906
import pytest
901907

@@ -942,7 +948,7 @@ pytest -m "slow not webtests"
942948
- Fixtures should be as close to tests as possible
943949
- Move fixtures from classes, to modules, to conftest.py
944950
- Each python file (x.py) should have a test file (test_x.py)
945-
- Test files mirror packages org. in tests/ directory
951+
- Test files mirror package org. in tests/ directory
946952
:::
947953

948954

0 commit comments

Comments
 (0)