Skip to content

Commit d520b12

Browse files
author
Alan Christie
committed
Some lint fixes
1 parent 781573d commit d520b12

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

jote/compose.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def create(self) -> str:
121121
'instance_directory': _INSTANCE_DIRECTORY}
122122
compose_content: str = _COMPOSE_CONTENT.format(**variables)
123123
compose_path: str = f'{test_path}/docker-compose.yml'
124-
with open(compose_path, 'wt') as compose_file:
124+
with open(compose_path, 'wt', encoding='UTF-8') as compose_file:
125125
compose_file.write(compose_content)
126126

127127
print('# Created')
@@ -166,7 +166,7 @@ def run(self) -> Tuple[int, str, str]:
166166
def delete(self) -> None:
167167
"""Deletes a test directory created by 'crete()'.
168168
"""
169-
print(f'# Deleting the test...')
169+
print('# Deleting the test...')
170170

171171
test_path: str = self.get_test_path()
172172
if os.path.exists(test_path):

jote/jote.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def _lint(definition_file: str) -> bool:
4444
print(f'! The yamllint file ({_YAMLLINT_FILE}) is missing')
4545
return False
4646

47-
errors = linter.run(open(definition_file),
47+
errors = linter.run(open(definition_file, encoding='UTF-8'),
4848
YamlLintConfig(file=_YAMLLINT_FILE))
4949
if errors:
5050
# We're given a 'generator' and we don't know if there are errors
@@ -104,7 +104,7 @@ def _load(skip_lint: bool = False) -> Tuple[List[DefaultMunch], int]:
104104
if not _lint(jd_filename):
105105
return [], -1
106106

107-
with open(jd_filename, 'r') as jd_file:
107+
with open(jd_filename, 'r', encoding='UTF-8') as jd_file:
108108
job_def: Dict[str, Any] = yaml.load(jd_file, Loader=yaml.FullLoader)
109109
if job_def:
110110
jd_munch: DefaultMunch = DefaultMunch.fromDict(job_def)
@@ -171,7 +171,7 @@ def _check_exists(name: str, path: str, expected: bool) -> bool:
171171
def _check_line_count(name: str, path: str, expected: int) -> bool:
172172

173173
line_count: int = 0
174-
for _ in open(path):
174+
for _ in open(path, encoding='UTF-8'):
175175
line_count += 1
176176

177177
if line_count != expected:
@@ -339,10 +339,10 @@ def _test(args: argparse.Namespace,
339339
job_definition.tests[job_test_name].checks.exitCode
340340

341341
if exit_code != expected_exit_code:
342-
print(f'! FAILURE')
342+
print('! FAILURE')
343343
print(f'! exit_code={exit_code}'
344344
f' expected_exit_code={expected_exit_code}')
345-
print(f'! Container output follows...')
345+
print('! Container output follows...')
346346
print(out)
347347
test_status = False
348348

@@ -471,7 +471,7 @@ def main() -> int:
471471
# If so wipe, and leave.
472472
if args.wipe:
473473
_wipe()
474-
print(f'Done [Wiped]')
474+
print('Done [Wiped]')
475475
return 0
476476

477477
# Load all the files we can and then run the tests.

0 commit comments

Comments
 (0)