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

Fix a few tests #96

Merged
merged 1 commit into from
Sep 22, 2024
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
5 changes: 5 additions & 0 deletions src/freesas/test/test_autorg.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ def test_synthetic(self):
)

def test_auto_gpa_with_outlier(self):
if "outlier_position" not in self.extra_arg:
raise unittest.SkipTest("No outlier position to test")

"""
Test that auto_gpa gives reasonalbe results
Expand Down Expand Up @@ -374,6 +376,9 @@ def test_curate_synthetic_data(self):
)

def test_curate_synthetic_data_with_negative_points(self):
if "negative_point_index" not in self.extra_arg:
raise unittest.SkipTest("No negative point index to test")

"""Test that if one of the first three points is negative, all date before it gets ignored."""
negative_point_index = self.extra_arg["negative_point_index"]

Expand Down
14 changes: 7 additions & 7 deletions src/freesas/test/test_sas_argparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_minimal_guinier_parser_requires_file_argument(self):
output_catcher = io.StringIO()
try:
with contextlib.redirect_stderr(output_catcher):
_ = basic_parser.parse_args()
_ = basic_parser.parse_args([])
except SystemExit:
pass

Expand Down Expand Up @@ -172,8 +172,8 @@ def test_minimal_parser_default_verbosity_level_is_0(self):
"""
Test that the parser sets the verbosity to 0 if no args are provided
"""
basic_parser = SASParser("program", "description", "epilog")
parsed_arguments = basic_parser.parse_args()
basic_parser = SASParser("program", "description", "epilog", exit_on_error=False)
parsed_arguments = basic_parser.parse_args([])
self.assertEqual(
parsed_arguments.verbose,
0,
Expand Down Expand Up @@ -268,8 +268,8 @@ def test_minimal_guinier_parser_accepts_output_file_argument(self):
parsed_arguments = basic_parser.parse_args(["afile", "-o", "out.file"])

self.assertEqual(
parsed_arguments.output,
Path("out.file"),
str(parsed_arguments.output),
str(Path("out.file")),
msg="Minimal GuinierParser accepts output file argument",
)

Expand Down Expand Up @@ -297,8 +297,8 @@ def test_add_output_filename_argument_adds_output_file_argument_to_SASParser(
parsed_arguments = basic_parser.parse_args(["-o", "out.file"])

self.assertEqual(
parsed_arguments.output,
Path("out.file"),
str(parsed_arguments.output),
str(Path("out.file")),
msg="SASParser accepts output file argument"
"after running add_output_filename_argument()",
)
Expand Down
Loading