pytest: strict config (#29676)

* pytest: strict config

* collection works

* fixes
old-commit-hash: 72e2e2c9ec
beeps
Adeeb Shihadeh 2 years ago committed by GitHub
parent 3627574114
commit cc29c6640d
  1. 4
      poetry.lock
  2. 6
      pyproject.toml
  3. 4
      system/loggerd/tests/test_uploader.py
  4. 5
      tools/plotjuggler/test_plotjuggler.py

4
poetry.lock generated

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:d819ba33852e8be375cc0914a1ac5b344df6fc200441f8daf45e3ab3c8787a88 oid sha256:bd848e2d24544e5ed93db3b68770036ddfd0af475f11a1a7c35f7ec84fd93a6c
size 376782 size 377110

@ -1,8 +1,8 @@
[tool.pytest.ini_options] [tool.pytest.ini_options]
minversion = "6.0" minversion = "6.0"
addopts = "--ignore=panda/ --ignore=rednose_repo/ --ignore=tinygrad_repo/ --ignore=laika_repo/" addopts = "--ignore=opendbc/ --ignore=panda/ --ignore=rednose_repo/ --ignore=tinygrad_repo/ --ignore=laika_repo/ -Werror --strict-config --strict-markers"
python_files = "test_*.py" python_files = "test_*.py"
timeout = "30" # you get this long by default #timeout = "30" # you get this long by default
[tool.mypy] [tool.mypy]
python_version = "3.11" python_version = "3.11"
@ -124,6 +124,8 @@ pytest = "*"
pytest-cov = "*" pytest-cov = "*"
pytest-subtests = "*" pytest-subtests = "*"
pytest-xdist = "*" pytest-xdist = "*"
pytest-timeout = "*"
pytest-timeouts = "*"
scipy = "*" scipy = "*"
sphinx = "*" sphinx = "*"
sphinx-rtd-theme = "*" sphinx-rtd-theme = "*"

@ -14,7 +14,7 @@ from openpilot.system.loggerd.uploader import uploader_fn, UPLOAD_ATTR_NAME, UPL
from openpilot.system.loggerd.tests.loggerd_tests_common import UploaderTestCase from openpilot.system.loggerd.tests.loggerd_tests_common import UploaderTestCase
class TestLogHandler(logging.Handler): class FakeLogHandler(logging.Handler):
def __init__(self): def __init__(self):
logging.Handler.__init__(self) logging.Handler.__init__(self)
self.reset() self.reset()
@ -33,7 +33,7 @@ class TestLogHandler(logging.Handler):
except Exception: except Exception:
pass pass
log_handler = TestLogHandler() log_handler = FakeLogHandler()
cloudlog.addHandler(log_handler) cloudlog.addHandler(log_handler)

@ -18,9 +18,8 @@ class TestPlotJuggler(unittest.TestCase):
install() install()
pj = os.path.join(PJ_DIR, "juggle.py") pj = os.path.join(PJ_DIR, "juggle.py")
p = subprocess.Popen(f'QT_QPA_PLATFORM=offscreen {pj} --demo None 1 --qlog', with subprocess.Popen(f'QT_QPA_PLATFORM=offscreen {pj} --demo None 1 --qlog',
stderr=subprocess.PIPE, shell=True, start_new_session=True) stderr=subprocess.PIPE, shell=True, start_new_session=True) as p:
# Wait for "Done reading Rlog data" signal from the plugin # Wait for "Done reading Rlog data" signal from the plugin
output = "\n" output = "\n"
with Timeout(180, error_msg=output): with Timeout(180, error_msg=output):

Loading…
Cancel
Save