@@ -58,7 +58,7 @@ def test_logging(capsys, tmp_path):
58
58
output_filename = str (tmp_path / 'logging.fits' )
59
59
skypy .main ([config_filename , output_filename ])
60
60
out , err = capsys .readouterr ()
61
- assert ( not err )
61
+ assert not err
62
62
63
63
# Run again with increased verbosity and capture log. Force an exception by
64
64
# not using the "--overwrite" flag when the output file already exists.
@@ -78,19 +78,19 @@ def test_logging(capsys, tmp_path):
78
78
# Check all jobs appear in the log
79
79
for job in list (config ) + list (tables ) + columns :
80
80
log_string = f"[INFO] skypy.pipeline: Generating { job } "
81
- assert ( log_string in err )
81
+ assert log_string in err
82
82
83
83
# Check all functions appear in the log
84
84
for f in functions :
85
85
log_string = f"[INFO] skypy.pipeline: Calling { f .function .__name__ } "
86
- assert ( log_string in err )
86
+ assert log_string in err
87
87
88
88
# Check cosmology appears in the log
89
89
if cosmology :
90
- assert ( "[INFO] skypy.pipeline: Setting cosmology" in err )
90
+ assert "[INFO] skypy.pipeline: Setting cosmology" in err
91
91
92
92
# Check writing output file is in the log
93
- assert ( f"[INFO] skypy: Writing { output_filename } " in err )
93
+ assert f"[INFO] skypy: Writing { output_filename } " in err
94
94
95
95
# Check error for existing output file is in the log
96
96
try :
@@ -100,10 +100,10 @@ def test_logging(capsys, tmp_path):
100
100
except ImportError :
101
101
# Fallback on old error message from astropy v4.x
102
102
error_string = f"[ERROR] skypy: File { output_filename !r} already exists."
103
- assert ( error_string in err )
103
+ assert error_string in err
104
104
105
105
# Run again with decreased verbosity and check the log is empty
106
106
with pytest .raises (SystemExit ):
107
107
skypy .main ([config_filename , output_filename , '-qq' ])
108
108
out , err = capsys .readouterr ()
109
- assert ( not err )
109
+ assert not err
0 commit comments