Skip to content

Doctests all around - #283

Merged
faif merged 5 commits into
faif:masterfrom
gyermolenko:doctests_all_around
Feb 17, 2019
Merged

faif merged 5 commits into
faif:masterfrom
gyermolenko:doctests_all_around

Conversation

@gyermolenko

@gyermolenko gyermolenko commented Feb 14, 2019 •

Copy link
Copy Markdown
Contributor

This PR is for discussion purposes but it contains changes which are ready to merge.
Please review from easiest to longest: Template, Adapter, Memento

Template: not much changed (I expect it to be the common case for other examples)

Adapter: I don't know why the diff is like that, it shows many functions I didn't touch. My advice for this particular commit is to compare before/after files by eye.
Because the important change is in one line:
before

# in main()
print(objects[0].__dict__)
# output
{'make_noise': <bound method Dog.bark of <__main__.Dog object at 0x7f631ba3fb00>>, 'obj': <__main__.Dog object at 0x7f631ba3fb00>}    # noqa flake8

after

 >>> objects[0].__dict__['obj'], objects[0].__dict__['make_noise']
(<...Dog object at 0x...>, <bound method Dog.bark of <...Dog object at 0x...>>)

"..." dots represent module and object memory address.

Memento
most of traceback is intentionally hidden under "..."

I will also describe some transition subtleties in #258 to discuss further

@faif please let me know if I should proceed with other examples.
Although this PR is ready as is.

@codecov-io

codecov-io commented Feb 15, 2019 •

Copy link
Copy Markdown

Codecov Report

Merging #283 into master will increase coverage by 0.14%.
The diff coverage is 40%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #283      +/-   ##
==========================================
+ Coverage   72.84%   72.99%   +0.14%     
==========================================
  Files          62       62              
  Lines        2224     2177      -47     
==========================================
- Hits         1620     1589      -31     
+ Misses        604      588      -16
Impacted Files Coverage Δ
tests/test_outputs.py 100% <ø> (ø) ⬆️
patterns/behavioral/template.py 0% <0%> (-96.67%) ⬇️
patterns/behavioral/memento.py 0% <0%> (ø) ⬆️
patterns/structural/adapter.py 87.87% <60%> (+24.83%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 995cb42...da85a02. Read the comment docs.

@faif
faif merged commit e0e9bfc into faif:master Feb 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants