Skip to content

Commit

Permalink
test tests
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Oct 28, 2024
1 parent 905cc04 commit 3f3c43b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
poetry install
- name: Run tests
run: |
poetry run pytest --exitfirst --show-capture=no --reruns 2 -o timeout_func_only=true --timeout 1200 --disable-warnings --log-cli-level=INFO --cov-config=bbot/test/coverage.cfg --cov-report xml:cov.xml --cov=bbot .
poetry run pytest --exitfirst -k test_test_output --show-capture=no --reruns 2 -o timeout_func_only=true --timeout 1200 --disable-warnings --log-cli-level=INFO --cov-config=bbot/test/coverage.cfg --cov-report xml:cov.xml --cov=bbot .
- name: Upload Debug Logs
uses: actions/upload-artifact@v3
with:
Expand Down
31 changes: 31 additions & 0 deletions bbot/test/test_step_1/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -925,3 +925,34 @@ def test_event_closest_host():
vuln = scan.make_event(
{"path": "/tmp/asdf.txt", "description": "test", "severity": "HIGH"}, "VULNERABILITY", parent=event3
)


def test_test_output():

import sys
import logging

root = logging.getLogger()
print("Root logger handlers:")
for h in root.handlers:
print(f" Handler: {type(h).__name__}")
print(f" Stream: {getattr(h, 'stream', 'no stream')}")
print(f" Level: {logging.getLevelName(h.level)}")
print(f" Formatter: {h.formatter._fmt if h.formatter else 'None'}")
print()

# Check other loggers too
for name in logging.root.manager.loggerDict:
logger = logging.getLogger(name)
if logger.handlers:
print(f"Logger '{name}' handlers:")
for h in logger.handlers:
print(f" Handler: {type(h).__name__}")
print(f" Stream: {getattr(h, 'stream', 'no stream')}")
print(f" Level: {logging.getLevelName(h.level)}")
print(f" Formatter: {h.formatter._fmt if h.formatter else 'None'}")
print()

import traceback

assert False, traceback.format_stack()

0 comments on commit 3f3c43b

Please sign in to comment.