Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
118fffa
Feat: Create unittest to pytest migration plan
google-labs-jules[bot] Dec 21, 2025
b3a3fed
Feat: Create unittest to pytest migration plan
google-labs-jules[bot] Dec 21, 2025
19b2af8
Feat: Create detailed unittest to pytest migration plan
google-labs-jules[bot] Dec 21, 2025
9d37a01
feat: Add pytest test utils and unittest migration plan
google-labs-jules[bot] Dec 21, 2025
84bfb03
feat: Add pytest test utils and unittest migration plan
google-labs-jules[bot] Dec 21, 2025
e2e89ba
feat: Add pytest test utils and unittest migration plan
google-labs-jules[bot] Dec 21, 2025
c897643
feat: Add pytest test utils and unittest migration plan
google-labs-jules[bot] Dec 21, 2025
45e550a
feat: Add pytest test utils and unittest migration plan
google-labs-jules[bot] Dec 21, 2025
67e2fb6
Feat: Create unittest to pytest migration plan
Voyz Dec 21, 2025
81dc7d7
feat: Migrate rest_client_i.py to pytest
google-labs-jules[bot] Dec 21, 2025
71f72c2
feat: Migrate rest_client_i.py to pytest and improve test readability
google-labs-jules[bot] Dec 21, 2025
d47822b
feat: Migrate rest_client_i.py to pytest and improve test readability
google-labs-jules[bot] Dec 21, 2025
79b4ad5
test: migrate rest_client_i.py to pytest
Voyz Dec 21, 2025
c413617
test: migrated test_ibkr_client_i.py to pytest
Voyz Dec 23, 2025
2aa9ca4
chore: added pytest-mock to requirements-dev.txt
Voyz Dec 23, 2025
0c8b1ea
tests: refactor pytest fixtures and autouse requests mocks
Voyz Dec 23, 2025
1c8fa0a
test: updated the migration plan
Voyz Dec 23, 2025
9c77b81
test: migrated test_py_utils_u.py to pytest
Voyz Dec 23, 2025
95a6c3e
test: migrated test_ibkr_utils_i.py to pytest
Voyz Dec 23, 2025
9be1104
test: migrated test_ibkr_ws_client_i.py and test_websocket_client_i.p…
Voyz Dec 24, 2025
b8b99b4
chore: temporarily added coverage old and new reports
Voyz Dec 24, 2025
9b618b2
test: updated pytest.ini
Voyz Dec 24, 2025
8eb4c49
test: small import fixes to new test files
Voyz Dec 24, 2025
222e6d4
test: replaced unittest test files with the new pytest files
Voyz Dec 24, 2025
22b8ac5
test: replaced test_utils with test_utils_new
Voyz Dec 24, 2025
1089a17
chore: removed coverage report files
Voyz Dec 24, 2025
ccb1df1
chore: removed migration_plan.md
Voyz Dec 24, 2025
38e0799
test: fixed Python<3.11 issues with \n\t by replacing \t with ` `
Voyz Dec 24, 2025
8a37f3e
test: fixed Python<3.11 issues with nested {...{\n\t ...}} by constru…
Voyz Dec 24, 2025
3b12c22
chore: removed leftover _NAME_TO_LEVEL = logging.getLevelNamesMapping()
Voyz Dec 24, 2025
ec1e3d4
chore(test): made test imports uniform
Voyz Jan 7, 2026
f73d79c
docs(test): added docstring to test_utils.py
Voyz Jan 7, 2026
b577f69
chore(test): fixed no_logs type hint in CaptureLogsContext
Voyz Jan 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion ibind/support/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import logging
import sys
from pathlib import Path
from typing import List

from ibind import var

Expand All @@ -11,6 +12,25 @@
_log_to_file = False


def get_logger_children(main_logger) -> List[logging.Logger]:
"""
Gets child loggers. Added as a support compat for Python version 3.11 and below.
Source: https://github.com/python/cpython/blob/3.12/Lib/logging/__init__.py#L1831
"""
if hasattr(main_logger, 'getChildren'):
return list(main_logger.getChildren())

def _hierlevel(logger):
if logger is logger.manager.root:
return 0
return 1 + logger.name.count('.')

d = main_logger.manager.loggerDict
return [item for item in d.values()
if isinstance(item, logging.Logger) and item.parent is main_logger and
_hierlevel(item) == 1 + _hierlevel(item.parent)]


def project_logger(filepath=None):
"""
Returns a project-specific logger instance.
Expand Down Expand Up @@ -152,4 +172,4 @@ def emit(self, record):
self.close()
self.stream = self._open()

super().emit(record)
super().emit(record)
12 changes: 8 additions & 4 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
[tool:pytest]
testpaths = test
pythonpath = . test
[pytest]
pythonpath = . ./test ./ibind
testpaths =
test
test/integration
test/unit
addopts = -v --tb=short
python_files = test_*.py
python_classes = Test*
python_functions = test_*
python_functions = test_*
norecursedirs = .* __pycache__ data .pytest_cache
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ ruff>=0.9.4,<0.10.0
bandit>=1.8.2,<2.0.0
pytest>=7.0.0,<9.0.0
pytest-cov>=4.0.0,<6.0.0

pytest-mock>=3.0.0,<4.0.0
Loading