| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 969dccc commit b8a47ba
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,6 +25,8 @@ jobs: | |||
| 25 | 25 | toxenv: py38 | |
| 26 | 26 | - python-version: 3.9 | |
| 27 | 27 | toxenv: py39 | |
| 28 | + - python-version: 3.9 | ||
| 29 | + toxenv: smoke | ||
| 28 | 30 | steps: | |
| 29 | 31 | - uses: actions/checkout@v2 | |
| 30 | 32 | - name: Set up Python ${{ matrix.python-version }} | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,7 +16,8 @@ module = [ | |||
| 16 | 16 | "setup", | |
| 17 | 17 | "tests.functional.*", | |
| 18 | 18 | "tests.functional.api.*", | |
| 19 | - "tests.unit.*" | ||
| 19 | + "tests.unit.*", | ||
| 20 | + "tests.smoke.*" | ||
| 20 | 21 | ] | |
| 21 | 22 | ignore_errors = true | |
| 22 | 23 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,33 @@ | |||
| 1 | + import tarfile | ||
| 2 | + import zipfile | ||
| 3 | + from pathlib import Path | ||
| 4 | + from sys import version_info | ||
| 5 | + | ||
| 6 | + import pytest | ||
| 7 | + from setuptools import sandbox | ||
| 8 | + | ||
| 9 | + from gitlab import __title__, __version__ | ||
| 10 | + | ||
| 11 | + DIST_DIR = Path("dist") | ||
| 12 | + TEST_DIR = "tests" | ||
| 13 | + SDIST_FILE = f"{__title__}-{__version__}.tar.gz" | ||
| 14 | + WHEEL_FILE = ( | ||
| 15 | + f"{__title__.replace('-', '_')}-{__version__}-py{version_info.major}-none-any.whl" | ||
| 16 | + ) | ||
| 17 | + | ||
| 18 | + | ||
| 19 | + @pytest.fixture(scope="function") | ||
| 20 | + def build(): | ||
| 21 | + sandbox.run_setup("setup.py", ["clean", "--all"]) | ||
| 22 | + return sandbox.run_setup("setup.py", ["sdist", "bdist_wheel"]) | ||
| 23 | + | ||
| 24 | + | ||
| 25 | + def test_sdist_includes_tests(build): | ||
| 26 | + sdist = tarfile.open(DIST_DIR / SDIST_FILE, "r:gz") | ||
| 27 | + test_dir = sdist.getmember(f"{__title__}-{__version__}/{TEST_DIR}") | ||
| 28 | + assert test_dir.isdir() | ||
| 29 | + | ||
| 30 | + | ||
| 31 | + def test_wheel_excludes_tests(build): | ||
| 32 | + wheel = zipfile.ZipFile(DIST_DIR / WHEEL_FILE) | ||
| 33 | + assert [not file.startswith(TEST_DIR) for file in wheel.namelist()] | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -96,3 +96,7 @@ commands = | |||
| 96 | 96 | deps = -r{toxinidir}/requirements-docker.txt | |
| 97 | 97 | commands = | |
| 98 | 98 | pytest --cov --cov-report xml tests/functional/api {posargs} | |
| 99 | + | ||
| 100 | + [testenv:smoke] | ||
| 101 | + deps = -r{toxinidir}/requirements-test.txt | ||
| 102 | + commands = pytest tests/smoke {posargs} | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments