Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add requires_internet mark to additional tests #171

Merged
merged 1 commit into from
Mar 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tests/cli/build/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,7 @@ def test_debug_verbosity(hatch, temp_dir, helpers):


@pytest.mark.allow_backend_process
@pytest.mark.requires_internet
def test_shipped(hatch, temp_dir, helpers):
project_name = 'My App'

Expand Down Expand Up @@ -1070,6 +1071,7 @@ def test_shipped(hatch, temp_dir, helpers):


@pytest.mark.allow_backend_process
@pytest.mark.requires_internet
def test_build_dependencies(hatch, temp_dir, helpers):
project_name = 'My App'

Expand Down
9 changes: 9 additions & 0 deletions tests/cli/env/test_create.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import pytest

from hatch.config.constants import AppEnvVars, ConfigEnvVars
from hatch.project.core import Project
from hatch.utils.structures import EnvVars
Expand Down Expand Up @@ -703,6 +705,7 @@ def test_incompatible_matrix_partial(hatch, helpers, temp_dir, config_file):
assert env_dirs[0].name == 'test.42'


@pytest.mark.requires_internet
def test_install_project_default_dev_mode(
hatch, helpers, temp_dir, platform, config_file, default_virtualenv_installed_packages
):
Expand Down Expand Up @@ -767,6 +770,7 @@ def test_install_project_default_dev_mode(
assert lines[2].lower() == f'-e {str(project_path).lower()}'


@pytest.mark.requires_internet
def test_install_project_no_dev_mode(
hatch, helpers, temp_dir, platform, config_file, default_virtualenv_installed_packages
):
Expand Down Expand Up @@ -830,6 +834,7 @@ def test_install_project_no_dev_mode(
assert lines[0].startswith('my-app @')


@pytest.mark.requires_internet
def test_pre_install_commands(hatch, helpers, temp_dir, config_file):
config_file.model.template.plugins['default']['tests'] = False
config_file.save()
Expand Down Expand Up @@ -906,6 +911,7 @@ def test_pre_install_commands_error(hatch, helpers, temp_dir, config_file):
)


@pytest.mark.requires_internet
def test_post_install_commands(hatch, helpers, temp_dir, config_file):
config_file.model.template.plugins['default']['tests'] = False
config_file.save()
Expand Down Expand Up @@ -946,6 +952,7 @@ def test_post_install_commands(hatch, helpers, temp_dir, config_file):
assert (project_path / 'test.txt').is_file()


@pytest.mark.requires_internet
def test_post_install_commands_error(hatch, helpers, temp_dir, config_file):
config_file.model.template.plugins['default']['tests'] = False
config_file.save()
Expand Down Expand Up @@ -983,6 +990,7 @@ def test_post_install_commands_error(hatch, helpers, temp_dir, config_file):
)


@pytest.mark.requires_internet
def test_sync_dependencies(hatch, helpers, temp_dir, platform, config_file, default_virtualenv_installed_packages):
config_file.model.template.plugins['default']['tests'] = False
config_file.save()
Expand Down Expand Up @@ -1058,6 +1066,7 @@ def test_sync_dependencies(hatch, helpers, temp_dir, platform, config_file, defa
assert lines[3].lower() == f'-e {str(project_path).lower()}'


@pytest.mark.requires_internet
def test_features(hatch, helpers, temp_dir, platform, config_file, default_virtualenv_installed_packages):
config_file.model.template.plugins['default']['tests'] = False
config_file.save()
Expand Down
3 changes: 3 additions & 0 deletions tests/cli/env/test_prune.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import pytest

from hatch.config.constants import AppEnvVars
from hatch.project.core import Project

Expand Down Expand Up @@ -31,6 +33,7 @@ def test_unknown_type(hatch, helpers, temp_dir_data, config_file):
)


@pytest.mark.requires_internet
def test_all(hatch, helpers, temp_dir_data, config_file, default_virtualenv_installed_packages):
project_name = 'My App'

Expand Down
6 changes: 6 additions & 0 deletions tests/cli/env/test_remove.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import pytest

from hatch.config.constants import AppEnvVars
from hatch.project.core import Project

Expand Down Expand Up @@ -40,6 +42,7 @@ def test_nonexistent(hatch, temp_dir_data, config_file):
assert not result.output


@pytest.mark.requires_internet
def test_single(hatch, helpers, temp_dir_data, config_file):
project_name = 'My App'

Expand Down Expand Up @@ -98,6 +101,7 @@ def test_single(hatch, helpers, temp_dir_data, config_file):
assert not bar_env_path.is_dir()


@pytest.mark.requires_internet
def test_all(hatch, helpers, temp_dir_data, config_file):
project_name = 'My App'

Expand Down Expand Up @@ -161,6 +165,7 @@ def test_all(hatch, helpers, temp_dir_data, config_file):
assert not storage_path.is_dir()


@pytest.mark.requires_internet
def test_matrix_all(hatch, helpers, temp_dir_data, config_file):
project_name = 'My App'

Expand Down Expand Up @@ -255,6 +260,7 @@ def test_active(hatch, temp_dir_data, helpers, config_file):
)


@pytest.mark.requires_internet
def test_active_override(hatch, helpers, temp_dir_data, config_file):
project_name = 'My App'

Expand Down
4 changes: 4 additions & 0 deletions tests/cli/run/test_run.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import sys

import pytest

from hatch.config.constants import AppEnvVars, ConfigEnvVars
from hatch.project.core import Project
from hatch.utils.structures import EnvVars
Expand Down Expand Up @@ -119,6 +121,7 @@ def test_enter_project_directory(hatch, config_file, helpers, temp_dir):
assert str(env_path) in str(output_file.read_text())


@pytest.mark.requires_internet
def test_sync_dependencies(hatch, helpers, temp_dir, config_file):
config_file.model.template.plugins['default']['tests'] = False
config_file.save()
Expand Down Expand Up @@ -313,6 +316,7 @@ def test_scripts_specific_environment(hatch, helpers, temp_dir, config_file):
assert env_var_value == 'bar'


@pytest.mark.requires_internet
def test_scripts_no_environment(hatch, temp_dir, config_file):
config_file.model.template.plugins['default']['tests'] = False
config_file.save()
Expand Down