mirror of
https://github.com/fedora-python/tox-current-env.git
synced 2025-08-21 22:18:52 +02:00
Improved tests and testing with tox 4
This commit is contained in:
committed by
Miro Hrončok
parent
b9030ccc0f
commit
b0923ba7ea
36
tests/conftest.py
Normal file
36
tests/conftest.py
Normal file
@@ -0,0 +1,36 @@
|
||||
import shutil
|
||||
|
||||
import pytest
|
||||
from utils import FIXTURES_DIR, TOX4
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def projdir(tmp_path, monkeypatch):
|
||||
pwd = tmp_path / "projdir"
|
||||
pwd.mkdir()
|
||||
for fname in "tox.ini", "setup.py":
|
||||
shutil.copy(FIXTURES_DIR / fname, pwd)
|
||||
monkeypatch.chdir(pwd)
|
||||
return pwd
|
||||
|
||||
|
||||
if TOX4:
|
||||
available_options = ("--print-deps-to-file=-", "--print-deps-to=-")
|
||||
else:
|
||||
available_options = (
|
||||
"--print-deps-only",
|
||||
"--print-deps-to-file=-",
|
||||
"--print-deps-to=-",
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture(params=available_options)
|
||||
def print_deps_stdout_arg(request):
|
||||
"""Argument for printing deps to stdout"""
|
||||
return request.param
|
||||
|
||||
|
||||
@pytest.fixture(params=("--print-extras-to-file=-", "--print-extras-to=-"))
|
||||
def print_extras_stdout_arg(request):
|
||||
"""Argument for printing extras to stdout"""
|
||||
return request.param
|
Reference in New Issue
Block a user