Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Add test_distribution. See #214
- Loading branch information
Showing
3 changed files
with
50 additions
and
5 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 |
---|---|---|
|
@@ -6,4 +6,5 @@ pytest==3.0.3 | |
pytest-cov==2.4.0 | ||
pytest-mock==1.4.0 | ||
pytest-runner==2.9 | ||
pytest-virtualenv==1.2.4 | ||
six==1.10.0 |
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,39 @@ | ||
|
||
import os | ||
import pytest | ||
|
||
from path import Path | ||
|
||
from . import initialize_git_repo_and_commit, prepare_project | ||
|
||
DIST_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '../dist')) | ||
|
||
|
||
def test_source_distribution(virtualenv): | ||
sdists = Path(DIST_DIR).files(pattern="*.tar.gz") | ||
if not sdists: | ||
pytest.skip("no source distribution available") | ||
assert len(sdists) == 1 | ||
|
||
virtualenv.run("pip install %s" % sdists[0]) | ||
assert "scikit-build" in virtualenv.installed_packages() | ||
|
||
prepare_project("hello", virtualenv.workspace, force=True) | ||
initialize_git_repo_and_commit(virtualenv.workspace, verbose=False) | ||
|
||
virtualenv.run("python setup.py bdist_wheel") | ||
|
||
|
||
def test_wheel(virtualenv): | ||
wheels = Path(DIST_DIR).files(pattern="*.whl") | ||
if not wheels: | ||
pytest.skip("no wheel available") | ||
assert len(wheels) == 1 | ||
|
||
virtualenv.run("pip install %s" % wheels[0]) | ||
assert "scikit-build" in virtualenv.installed_packages() | ||
|
||
prepare_project("hello", virtualenv.workspace, force=True) | ||
initialize_git_repo_and_commit(virtualenv.workspace, verbose=False) | ||
|
||
virtualenv.run("python setup.py bdist_wheel") |