def test_about(): """ about: Tests if the about string prints correctly. """ f = io.StringIO() with contextlib.redirect_stdout(f): tw.about() out = f.getvalue().strip() assert "Python version:" in out pl_version_match = re.search(r"The Walrus version:\s+([\S]+)\n", out).group(1) assert tw.version() in pl_version_match assert "Numpy version" in out assert "Scipy version" in out assert "SymPy version" in out assert "Numba version" in out
# The master toctree document. master_doc = 'index' # General information about the project. project = 'The Walrus' copyright = '2019, Xanadu Quantum Technologies Inc' author = 'Xanadu Inc.' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The full version, including alpha/beta/rc tags. import thewalrus release = thewalrus.version() # The short X.Y version. version = re.match(r'^(\d+\.\d+)', release).expand(r'\1') # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call.
def test_version_number(self): """returns true if returns a string""" res = hf.version() assert isinstance(res, str)