mirror of
https://github.com/jupyter/notebook.git
synced 2025-04-24 14:20:54 +08:00
Move test function to test file
This commit is contained in:
parent
8c379f073d
commit
0b44f64e9d
@ -9,14 +9,13 @@ store the current version info of the notebook.
|
||||
|
||||
# Next beta/alpha/rc release: The version number for beta is X.Y.ZbN **without dots**.
|
||||
|
||||
version_info = (4, 1, '0b1')
|
||||
version_info = (4, 1, 0, 'b1')
|
||||
__version__ = '.'.join(map(str, version_info[:3])) + ''.join(version_info[3:])
|
||||
|
||||
import re
|
||||
|
||||
pep440re = re.compile('^(\d+)\.(\d+)\.(\d+((a|b|rc)\d+)?)(\.post\d+)?(\.dev\d+)?$')
|
||||
|
||||
|
||||
|
||||
def raise_on_bad_version(version):
|
||||
if not pep440re.match(version):
|
||||
raise ValueError("Versions String does apparently not match Pep 440 specification, "
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
from tempfile import NamedTemporaryFile
|
||||
|
||||
import nose.tools as nt
|
||||
@ -15,8 +16,6 @@ from traitlets import TraitError
|
||||
from notebook import notebookapp, __version__
|
||||
NotebookApp = notebookapp.NotebookApp
|
||||
|
||||
from notebook._version import raise_on_bad_version
|
||||
|
||||
|
||||
def test_help_output():
|
||||
"""ipython notebook --help-all works"""
|
||||
@ -100,5 +99,16 @@ def test_pep440_version():
|
||||
|
||||
yield (raise_on_bad_version, version)
|
||||
|
||||
|
||||
|
||||
pep440re = re.compile('^(\d+)\.(\d+)\.(\d+((a|b|rc)\d+)?)(\.post\d+)?(\.dev\d+)?$')
|
||||
|
||||
def raise_on_bad_version(version):
|
||||
if not pep440re.match(version):
|
||||
raise ValueError("Versions String does apparently not match Pep 440 specification, "
|
||||
"which might lead to sdist and wheel being seen as 2 different release. "
|
||||
"E.g: do not use dots for beta/alpha/rc markers.")
|
||||
|
||||
|
||||
def test_current_version():
|
||||
raise_on_bad_version(__version__)
|
||||
|
Loading…
x
Reference in New Issue
Block a user