Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
robnagler committed Mar 28, 2024
1 parent b82970d commit 5dd63f1
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions pykern/pkcli/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,19 +180,16 @@ def _fail(output):
def _ignore_warnings():
if not _cfg.ignore_warnings:
return []
return list(
# This undoes what pytest does
itertools.chain.from_iterable(
("-W", f"ignore::{w}")
for w in (
# https://docs.python.org/3/library/warnings.html#default-warning-filter
"DeprecationWarning",
"PendingDeprecationWarning",
"ImportWarning",
"ResourceWarning",
)
),
)
rv = []
for w in (
# https://docs.python.org/3/library/warnings.html#default-warning-filter
"DeprecationWarning",
"PendingDeprecationWarning",
"ImportWarning",
"ResourceWarning",
):
rv.extend(("-W", f"ignore::{w}"))
return rv

def _try(output, restartable):
sys.stdout.write(test_f)
Expand Down

0 comments on commit 5dd63f1

Please sign in to comment.