Skip to content

Commit a4f1233

Browse files
committed
chore(internationalization): add a test to prevent future regressions
1 parent 7572235 commit a4f1233

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/test_internationalization.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,24 @@
1212

1313
import argparse
1414
import unittest
15+
from os import path as os_path
1516

1617
import pytest
1718

1819
from ardupilot_methodic_configurator.internationalization import LANGUAGE_CHOICES, identity_function, load_translation
1920

2021

22+
@pytest.mark.usefixtures("mock_args_de")
23+
def test_no_logging_import() -> None:
24+
"""Test that logging is not imported in internationalization.py."""
25+
with open(
26+
os_path.join(os_path.dirname(__file__), "../ardupilot_methodic_configurator/internationalization.py"), encoding="utf-8"
27+
) as f:
28+
content = f.read()
29+
assert "import logging" not in content
30+
assert "from logging import" not in content
31+
32+
2133
class TestInternationalization(unittest.TestCase):
2234
"""Test the internationalization functions."""
2335

0 commit comments

Comments
 (0)