Skip to content

Commit

Permalink
added pytest.ini and .coveragerc
Browse files Browse the repository at this point in the history
  • Loading branch information
dweinholz committed Jan 4, 2024
1 parent b77e1c5 commit 64ea82b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
14 changes: 14 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[run]
omit =
simple_vm_client/VirtualMachineService.py
simple_vm_client/constants.py
simple_vm_client/test_openstack_connector.py
simple_vm_client/ttypes.py
simple_vm_client/forc_connector/template/test_templates.py
simple_vm_client/util/logger.py

[report]
exclude_lines =
pragma: no cover
raise NotImplementedError
if __name__ == .__main__.:
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Build coverage file
run: |
pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=simple_vm_client/openstack_connector --cov=simple_vm_client/bibigrid_connector --cov=simple_vm_client/util --cov=simple_vm_client/forc_connector | tee pytest-coverage.txt
pytest --junitxml=pytest.xml | tee pytest-coverage.txt
- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@main
Expand Down
6 changes: 6 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# pytest.ini

[pytest]
addopts = --cov=. --cov-config=.coveragerc

# Add other configuration options as needed
6 changes: 3 additions & 3 deletions simple_vm_client/test_openstack_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -2909,7 +2909,7 @@ def test___init__(self, mock_authorize):
with tempfile.NamedTemporaryFile(mode="w+", delete=False) as temp_file:
temp_file.write(CONFIG_DATA)
# Call the __init__ method
OpenStackConnector(config_file=temp_file.name)
OpenStackConnector(config_file=temp_file.name)
os.remove(temp_file.name)
# Assertions

Expand All @@ -2922,7 +2922,7 @@ def test___init__failed_auth(self):
temp_file.write(CONFIG_DATA)
# Call the __init__ method
with self.assertRaises(Exception):
openstack_connector = OpenStackConnector(config_file=temp_file.name)
OpenStackConnector(config_file=temp_file.name)
os.remove(temp_file.name)
# Assertions

Expand All @@ -2941,7 +2941,7 @@ def test___init__os_creds(self, mock_authorize):
with tempfile.NamedTemporaryFile(mode="w+", delete=False) as temp_file:
temp_file.write(CONFIG_DATA)
# Call the __init__ method
OpenStackConnector(config_file=temp_file.name)
OpenStackConnector(config_file=temp_file.name)
os.remove(temp_file.name)
# Assertions

Expand Down

0 comments on commit 64ea82b

Please sign in to comment.