Skip to content

Commit

Permalink
Merge branch 'master' into error-when-invalid-lock-file
Browse files Browse the repository at this point in the history
  • Loading branch information
radoering authored Oct 14, 2023
2 parents b807f42 + 9360531 commit d9d31b2
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ ignore_missing_imports = true
[tool.pytest.ini_options]
addopts = "-n auto"
testpaths = ["tests"]
markers = [
"network: mark tests that require internet access",
]


[tool.coverage.report]
Expand Down
5 changes: 4 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ def pytest_configure(config: PyTestConfig) -> None:
config.addinivalue_line("markers", "integration: mark integration tests")

if not config.option.integration:
config.option.markexpr = "not integration"
if config.option.markexpr:
config.option.markexpr += " and not integration"
else:
config.option.markexpr = "not integration"


class Config(BaseConfig):
Expand Down
3 changes: 3 additions & 0 deletions tests/inspection/test_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ def test_info_setup_cfg(mocker: MockerFixture, demo_setup_cfg: Path) -> None:
demo_check_info(info, requires_dist={"package"})


@pytest.mark.network
def test_info_setup_complex(demo_setup_complex: Path) -> None:
info = PackageInfo.from_directory(demo_setup_complex)
demo_check_info(info, requires_dist={"package"})
Expand All @@ -213,6 +214,7 @@ def test_info_setup_complex_pep517_error(
PackageInfo.from_directory(demo_setup_complex)


@pytest.mark.network
def test_info_setup_complex_pep517_legacy(
demo_setup_complex_pep517_legacy: Path,
) -> None:
Expand All @@ -231,6 +233,7 @@ def test_info_setup_complex_disable_build(
assert info.requires_dist is None


@pytest.mark.network
@pytest.mark.parametrize("missing", ["version", "name", "install_requires"])
def test_info_setup_missing_mandatory_should_trigger_pep517(
mocker: MockerFixture, source_dir: Path, missing: str
Expand Down
4 changes: 4 additions & 0 deletions tests/installation/test_chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def test_isolated_env_install_failure(
assert e.value.requirements == {"a", "b>1"}


@pytest.mark.network
def test_prepare_sdist(
config: Config,
config_cache_dir: Path,
Expand All @@ -101,6 +102,7 @@ def test_prepare_sdist(
assert wheel.name == "demo-0.1.0-py3-none-any.whl"


@pytest.mark.network
def test_prepare_directory(
config: Config,
config_cache_dir: Path,
Expand All @@ -121,6 +123,7 @@ def test_prepare_directory(
os.unlink(wheel)


@pytest.mark.network
def test_prepare_directory_with_extensions(
config: Config,
config_cache_dir: Path,
Expand All @@ -140,6 +143,7 @@ def test_prepare_directory_with_extensions(
os.unlink(wheel)


@pytest.mark.network
def test_prepare_directory_editable(
config: Config,
config_cache_dir: Path,
Expand Down
1 change: 1 addition & 0 deletions tests/installation/test_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1152,6 +1152,7 @@ def test_run_installs_extras_with_deps_if_requested_locked(
assert installer.executor.installations_count == 4 # A, B, C, D


@pytest.mark.network
def test_installer_with_pypi_repository(
package: ProjectPackage,
locker: Locker,
Expand Down
1 change: 1 addition & 0 deletions tests/masonry/builders/test_editable_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ def test_builder_falls_back_on_setup_and_pip_for_packages_with_build_scripts(
assert [] == env.executed


@pytest.mark.network
def test_builder_setup_generation_runs_with_pip_editable(
fixture_dir: FixtureDirGetter, tmp_path: Path
) -> None:
Expand Down

0 comments on commit d9d31b2

Please sign in to comment.