Skip to content

Conversation

@mthuurne
Copy link
Contributor

@mthuurne mthuurne commented Dec 7, 2019

This fixes four warnings that were shown when running pytest -Wd under Python 3.6.

There is one remaining warning, but that does not reside in pydoctor itsefl:

pydoctor/test/test_sphinx.py::TestIntersphinxCache::test_cache
  [...]/site-packages/cachecontrol/serialize.py:182: DeprecationWarning: encoding is deprecated, Use raw=False instead.
    cached = msgpack.loads(data, encoding="utf-8")

This issue has been fixed in CacheControl already, but there hasn't been a release since the fix was integrated.

This was always more safe, but under Python 3.6+ it also avoids
warnings about invalid escapes.
Read file as binary. This is accepted by ast.parse(). Previously the
mode "U" (universal newlines) was used, but this is deprecated since
Python 3.4 and scheduled for removal in 3.9. While universal newlines
is still present as a feature, the syntax to enable it is different
for Python 2 vs 3, so reading as a binary is easier.

Use open() in a 'with' statement to ensure that the file is properly
closed even when reading fails. It's also shorter.

The docstring referred to the 'compile' module and the 'MyTransformer'
class, both of which are no longer used since we switched to parsing
with the 'ast' module. This docstring and also the one of parse()
were updated.
This avoids a warning when testing under Python 3.6.
Instead of using inspect.getargspec(), we now hardcode the expected
values. This simplifies the test code and avoids a deprecation
warning under Python 3.
@codecov
Copy link

codecov bot commented Dec 7, 2019

Codecov Report

Merging #172 into master will increase coverage by 0.29%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #172      +/-   ##
==========================================
+ Coverage   69.55%   69.84%   +0.29%     
==========================================
  Files          27       27              
  Lines        3616     3615       -1     
  Branches      785      823      +38     
==========================================
+ Hits         2515     2525      +10     
+ Misses        832      825       -7     
+ Partials      269      265       -4
Impacted Files Coverage Δ
pydoctor/astbuilder.py 83.12% <100%> (+1.71%) ⬆️
pydoctor/zopeinterface.py 72.55% <100%> (ø) ⬆️
pydoctor/epydoc2stan.py 65.13% <0%> (+0.91%) ⬆️

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 2f00db6...312cecf. Read the comment docs.

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.

2 participants