diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2022-12-16 08:53:28 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-16 08:53:28 -0500 |
commit | 3aeca2588b79111a48a6083c88efc4d68a2cea19 (patch) | |
tree | cd1850aba9ddcb05a9b357541a5c20b6ca617b99 /tests/config/utils.py | |
parent | Improve type annotations for the helper methods on a `CachedFunction`. (#14685) (diff) | |
download | synapse-3aeca2588b79111a48a6083c88efc4d68a2cea19.tar.xz |
Add missing type hints to tests.config. (#14681)
Diffstat (limited to 'tests/config/utils.py')
-rw-r--r-- | tests/config/utils.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/config/utils.py b/tests/config/utils.py index 94c18a052b..4c0e8a064a 100644 --- a/tests/config/utils.py +++ b/tests/config/utils.py @@ -17,19 +17,20 @@ import tempfile import unittest from contextlib import redirect_stdout from io import StringIO +from typing import List from synapse.config.homeserver import HomeServerConfig class ConfigFileTestCase(unittest.TestCase): - def setUp(self): + def setUp(self) -> None: self.dir = tempfile.mkdtemp() self.config_file = os.path.join(self.dir, "homeserver.yaml") - def tearDown(self): + def tearDown(self) -> None: shutil.rmtree(self.dir) - def generate_config(self): + def generate_config(self) -> None: with redirect_stdout(StringIO()): HomeServerConfig.load_or_generate_config( "", @@ -43,7 +44,7 @@ class ConfigFileTestCase(unittest.TestCase): ], ) - def generate_config_and_remove_lines_containing(self, needle): + def generate_config_and_remove_lines_containing(self, needle: str) -> None: self.generate_config() with open(self.config_file) as f: @@ -52,7 +53,7 @@ class ConfigFileTestCase(unittest.TestCase): with open(self.config_file, "w") as f: f.write("".join(contents)) - def add_lines_to_config(self, lines): + def add_lines_to_config(self, lines: List[str]) -> None: with open(self.config_file, "a") as f: for line in lines: f.write(line + "\n") |