generated from neutrons/python_project_template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Testing Framework and initial tests (#2)
* test configurations, main window tests added, pytest additional dependencies added, argument parser updated * ruff D code added, docstrings in functions and files everywhere * pytest-xvfb added
- Loading branch information
Showing
15 changed files
with
355 additions
and
17 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
[global.other] | ||
#url to documentation | ||
help_url = https://github.com/neutrons/HyspecPlanningTools/blob/next/README.md |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
"""pytest configuration""" | ||
|
||
import os | ||
from configparser import ConfigParser | ||
|
||
import pytest | ||
|
||
from hyspecplanningtools import HyspecPlanningTool | ||
|
||
|
||
@pytest.fixture | ||
def hyspec_app(qapp): # noqa: ARG001 | ||
"""Create a HyspecPlanningTool app""" | ||
app = HyspecPlanningTool() | ||
app.show() | ||
return app | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def user_conf_file(tmp_path_factory, request): | ||
"""Fixture to create a custom configuration file in tmp_path""" | ||
# custom configuration file | ||
config_data = request.param | ||
user_config = ConfigParser(allow_no_value=True) | ||
user_config.read_string(config_data) | ||
user_path = os.path.join(tmp_path_factory.mktemp("data"), "test_config.ini") | ||
with open(user_path, "w", encoding="utf8") as config_file: | ||
user_config.write(config_file) | ||
return user_path |
Oops, something went wrong.