Skip to content

Commit

Permalink
t use production code
Browse files Browse the repository at this point in the history
Co-Authored-By: Nazee Hajebi <2491283+NazeeHajebi@users.noreply.github.com>
Co-Authored-By: blade290 <43077216+blade290@users.noreply.github.com>
  • Loading branch information
3 people committed Jul 16, 2023
1 parent 26f2bbd commit 48cacf1
Showing 1 changed file with 1 addition and 32 deletions.
33 changes: 1 addition & 32 deletions tests/logging/test_logging.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,7 @@
import logging
from datetime import datetime
from typing import Optional, ContextManager

from approvaltests import Options, verify
from testfixtures import LogCapture

from approvaltests.scrubbers.date_scrubber import DateScrubber


def verify_logging(
*, # enforce keyword arguments - https://www.python.org/dev/peps/pep-3102/
options: Optional[Options] = None
) -> ContextManager:
class VerifyLogging:
def __init__(self):
self.l = LogCapture()
self.output = "anything"
self.options = options
if not options:
self.options = Options()

def __enter__(self):
self.l.__enter__()

pass

def __exit__(self, exc_type, exc_val, exc_tb):
self.l.__exit__(exc_type, exc_val, exc_tb)
self.options = self.options.with_scrubber(
DateScrubber.get_scrubber_for("2023-07-16 17:39:03.293919")
)
verify(self.l, options=self.options)

return VerifyLogging()
from approvaltests.utilities.logging.logging_approvals import verify_logging


def test_basic_logging():
Expand Down

0 comments on commit 48cacf1

Please sign in to comment.