Skip to content

Commit

Permalink
tests: run doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver-sanders committed Jun 11, 2021
1 parent 4b9c0a9 commit 9247c86
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 5 additions & 5 deletions jupyter_server/auth/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ def passwd(passphrase=None, algorithm='argon2'):
Examples
--------
>>> passwd('mypassword')
'sha1:7cf3:b7d6da294ea9592a9480c8f52e63cd42cfb9dd12'
>>> passwd('mypassword') # doctest: +ELLIPSIS
'argon2:...'
"""
if passphrase is None:
Expand Down Expand Up @@ -94,11 +94,11 @@ def passwd_check(hashed_passphrase, passphrase):
Examples
--------
>>> from jupyter_server.auth.security import passwd_check
>>> passwd_check('argon2:...', 'mypassword')
>>> myhash = passwd('mypassword')
>>> passwd_check(myhash, 'mypassword')
True
>>> passwd_check('argon2:...', 'otherpassword')
>>> passwd_check(myhash, 'otherpassword')
False
>>> passwd_check('sha1:0e112c3ddfce:a68df677475c2b47b6e86d0467eec97ac5f4b85a',
Expand Down
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ factory = "jupyter_packaging.npm_builder"
ignore = ["tbump.toml", ".*", "*.yml", "package-lock.json", "bootstrap*"]

[tool.pytest.ini_options]
# Exclude the example tests.
norecursedirs = "examples/*"
addopts = "--doctest-modules"
testpaths = [
"jupyter_server"
]

[tool.tbump.version]
current = "1.9.0.dev0"
Expand Down

0 comments on commit 9247c86

Please sign in to comment.