MAINT: Cleanup conditionals (#2820)

diff --git a/codespell_lib/_codespell.py b/codespell_lib/_codespell.py
index d64cc73..6726a58 100644
--- a/codespell_lib/_codespell.py
+++ b/codespell_lib/_codespell.py
@@ -216,8 +216,7 @@
     def open(self, filename: str) -> Tuple[List[str], str]:
         if self.use_chardet:
             return self.open_with_chardet(filename)
-        else:
-            return self.open_with_internal(filename)
+        return self.open_with_internal(filename)
 
     def open_with_chardet(self, filename: str) -> Tuple[List[str], str]:
         self.encdetector.reset()
@@ -672,7 +671,7 @@
 def fix_case(word: str, fixword: str) -> str:
     if word == word.capitalize():
         return ", ".join(w.strip().capitalize() for w in fixword.split(","))
-    elif word == word.upper():
+    if word == word.upper():
         return fixword.upper()
     # they are both lower case
     # or we don't have any idea
diff --git a/codespell_lib/tests/test_basic.py b/codespell_lib/tests/test_basic.py
index 2d9fb7e..7a6e331 100644
--- a/codespell_lib/tests/test_basic.py
+++ b/codespell_lib/tests/test_basic.py
@@ -50,8 +50,7 @@
             assert code == 0
         if std:
             return (code, stdout, stderr)
-        else:
-            return code
+        return code
 
 
 cs = MainWrapper()
@@ -172,7 +171,7 @@
     assert cs.main("--skip", "[[]b-a[]].txt", g) == 0
 
 
-@pytest.mark.skipif(not sys.platform == "linux", reason="Only supported on Linux")
+@pytest.mark.skipif(sys.platform != "linux", reason="Only supported on Linux")
 def test_permission_error(
     tmp_path: Path,
     capsys: pytest.CaptureFixture[str],
diff --git a/codespell_lib/tests/test_dictionary.py b/codespell_lib/tests/test_dictionary.py
index 7fb9ea3..99db815 100644
--- a/codespell_lib/tests/test_dictionary.py
+++ b/codespell_lib/tests/test_dictionary.py
@@ -22,12 +22,11 @@
             "Cannot run complete tests without aspell when "
             "REQUIRE_ASPELL=true. Got error during import:\n{}".format(exp)
         )
-    else:
-        warnings.warn(
-            "aspell not found, but not required, skipping aspell tests. Got "
-            "error during import:\n{}".format(exp),
-            stacklevel=2,
-        )
+    warnings.warn(
+        "aspell not found, but not required, skipping aspell tests. Got "
+        "error during import:\n{}".format(exp),
+        stacklevel=2,
+    )
 
 global_err_dicts: Dict[str, Dict[str, Any]] = {}
 global_pairs: Set[Tuple[str, str]] = set()
@@ -66,7 +65,7 @@
             try:
                 _check_err_rep(err, rep, in_aspell, fname, in_dictionary)
             except AssertionError as exp:
-                errors.append(str(exp).split("\n")[0])
+                errors.append(str(exp).split("\n", maxsplit=1)[0])
     if errors:
         raise AssertionError("\n" + "\n".join(errors))