Skip to content

Commit

Permalink
Improve coverage of tests themselves (#1417)
Browse files Browse the repository at this point in the history
  • Loading branch information
ofek authored Apr 22, 2024
1 parent 59fef2a commit acece09
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
1 change: 0 additions & 1 deletion tests/backend/builders/plugin/test_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ def test_invalid_metadata(self, isolation):
}
builder = MockBuilder(str(isolation), config=config)
builder.PLUGIN_NAME = 'foo'
builder.get_version_api = lambda: {'1': lambda *_args, **_kwargs: ''}

with pytest.raises(
ValueError,
Expand Down
2 changes: 1 addition & 1 deletion tests/backend/builders/test_binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self, env_vars: dict):
def __eq__(self, other):
return all(not (key not in other or other[key] != value) for key, value in self.env_vars.items())

def __hash__(self):
def __hash__(self): # no cov
return hash(self.env_vars)


Expand Down
5 changes: 1 addition & 4 deletions tests/backend/builders/test_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ def extract_zip(zip_path: Path, target: Path) -> None:
for name in z.namelist():
member = z.getinfo(name)
path = z.extract(member, target)
if member.is_dir():
os.chmod(path, 0o755)
else:
os.chmod(path, member.external_attr >> 16)
os.chmod(path, member.external_attr >> 16)


def test_class():
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ def pytest_runtest_setup(item):
if marker.name == 'requires_unix' and PLATFORM.windows:
pytest.skip('Not running on a Linux-based platform')

if marker.name == 'requires_git' and not shutil.which('git'):
if marker.name == 'requires_git' and not shutil.which('git'): # no cov
pytest.skip('Git not present in the environment')


Expand Down

0 comments on commit acece09

Please sign in to comment.