8000 Add more tests to the descriptor howto guide by rhettinger · Pull Request #23506 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

Add more tests to the descriptor howto guide #23506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 25, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use basicConfig() rather than a mock.
  • Loading branch information
rhettinger committed Nov 25, 2020
commit d9006ddb50984e85a57ac43ea1dfcef133cec2c8
9 changes: 3 additions & 6 deletions Doc/howto/descriptor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,8 @@ logged, but that the regular attribute *name* is not logged:
.. testcode::
:hide:

# Mock logging to make it work with docttest
class logging:
@staticmethod
def info(message, *args):
print('INFO:root:' + message % args)
import logging, sys
logging.basicConfig(level=logging.INFO, stream=sys.stdout, force=True)

.. doctest::

Expand Down Expand Up @@ -273,7 +270,7 @@ The new class now logs access to both *name* and *age*:
:hide:

import logging, sys
logging.basicConfig(level=logging.INFO, stream=sys.stdout)
logging.basicConfig(level=logging.INFO, stream=sys.stdout, force=True)

.. doctest::

Expand Down
0