-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CP-48198: Support running pytest within the test directories
Signed-off-by: Bernhard Kaindl <bernhard.kaindl@cloud.com>
- Loading branch information
1 parent
15ab34d
commit 117d1d7
Showing
8 changed files
with
65 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
"""tests/conftest.py: top-level pytest fixtures for testing xen-bugtool | ||
Introduction to fixtures: | ||
https://docs.pytest.org/en/8.0.x/fixture.html | ||
How to use fixtures: | ||
https://docs.pytest.org/en/8.0.x/how-to/fixtures.html | ||
The full documentation on fixtures: | ||
https://docs.pytest.org/en/8.0.x/reference/fixtures.html | ||
""" | ||
|
||
import os | ||
|
||
import pytest | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def tests_dir(): | ||
"""pytest fixture to provide the path to status-report/tests""" | ||
return os.path.dirname(__file__) | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def bugtool_script(tests_dir): | ||
"""pytest fixture to provide the path to status-report/tests""" | ||
return os.path.abspath(os.path.join(tests_dir, os.pardir, "xen-bugtool")) | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def mocks_dir(tests_dir): | ||
"""pytest fixture to provide the path to status-report/tests/mocks""" | ||
return os.path.join(tests_dir, "mocks") | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def dom0_template(tests_dir): | ||
"""Fixture to provide the path to status-report/tests/integration/dom0-template""" | ||
return os.path.join(tests_dir, "integration", "dom0-template") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters