-
Notifications
You must be signed in to change notification settings - Fork 628
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2110 from gadhvirushiraj/rushiDev
Fix version_table to work without Cython installed
- Loading branch information
Showing
3 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
qutip.ipynbtools.version_table() can now be called without Cython installed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from qutip.ipynbtools import version_table | ||
import pytest | ||
|
||
|
||
@pytest.mark.parametrize('verbose', [False, True]) | ||
def test_version_table(verbose): | ||
html_data = version_table(verbose=verbose).data | ||
assert "<th>Software</th>" in html_data | ||
assert "<th>Version</th>" in html_data | ||
assert "<td>QuTiP</td>" in html_data | ||
assert "<td>Numpy</td>" in html_data | ||
assert "<td>SciPy</td>" in html_data | ||
assert "<td>matplotlib</td>" in html_data | ||
assert "<td>IPython</td>" in html_data | ||
if verbose: | ||
assert "<td>Installation path</td>" in html_data | ||
if pytest.importorskip("getpass") is not None: | ||
assert "<td>User</td>" in html_data | ||
|
||
|
||
@pytest.mark.skipif(not pytest.importorskip("Cython"), reason="cython not installed") | ||
def test_version_table_with_cython(): | ||
html_data = version_table().data | ||
assert "<td>Cython</td>" in html_data |