I do like your doctest.  I'm simply suggesting that it look like the following

```Python
>>> frequencies(['cat', 'cat', 'dog', 'pig', 'pig', 'cat'])  #doctest: +SKIP
{'cat': 3, 'dog': 1, 'pig': 2}
```