Skip to content

Commit

Permalink
tests: remove usage of raw path
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
  • Loading branch information
henryiii committed Dec 1, 2022
1 parent a9a5f94 commit c1d52df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ coverage>=4.2
cython>=0.25.1
flake8>=3.0.4
importlib-metadata;python_version<"3.8"
path.py>=11.5.0
pytest>=6.0.0
pytest-cov>=2.7.1
pytest-mock>=1.10.4
Expand Down
10 changes: 5 additions & 5 deletions tests/test_distribution.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import os
from pathlib import Path

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"))
DIR = Path(__file__).parent.resolve()
DIST_DIR = DIR.parent / "dist"

# Test if package can be imported to allow testing on
# conda-forge where ``pytest-virtualenv`` is not available.
pytest.importorskip("pytest_virtualenv", reason="pytest_virtualenv not available. See #228")


def test_source_distribution(virtualenv):
sdists = Path(DIST_DIR).files(match="*.tar.gz") if Path(DIST_DIR).exists() else []
sdists = DIST_DIR.glob("*.tar.gz") if DIST_DIR.exists() else []
if not sdists:
pytest.skip("no source distribution available")
assert len(sdists) == 1
Expand All @@ -28,7 +28,7 @@ def test_source_distribution(virtualenv):


def test_wheel(virtualenv):
wheels = Path(DIST_DIR).files(match="*.whl") if Path(DIST_DIR).exists() else []
wheels = DIST_DIR.glob("*.whl") if DIST_DIR.exists() else []
if not wheels:
pytest.skip("no wheel available")
assert len(wheels) == 1
Expand Down

0 comments on commit c1d52df

Please sign in to comment.