ci: Run optimized python and control warnings (#28063)
* ci: run doubly optimized python * ci: control python warnings
This commit is contained in:
parent
9024441ee9
commit
bd06784d1b
4 changed files with 9 additions and 8 deletions
3
.github/workflows/server-tests.yml
vendored
3
.github/workflows/server-tests.yml
vendored
|
|
@ -46,6 +46,9 @@ jobs:
|
|||
timeout-minutes: 30
|
||||
env:
|
||||
NODE_ENV: "production"
|
||||
PYTHONOPTIMIZE: 2
|
||||
# noisy 3rd party library warnings
|
||||
PYTHONWARNINGS: "module,ignore:::babel.messages.extract"
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
|
|
|||
|
|
@ -32,8 +32,6 @@ class ParallelTestRunner:
|
|||
self.total_tests = 0
|
||||
self.test_result = None
|
||||
self.setup_test_file_list()
|
||||
warnings.simplefilter("module", DeprecationWarning)
|
||||
warnings.simplefilter("module", PendingDeprecationWarning)
|
||||
|
||||
def setup_and_run(self):
|
||||
self.setup_test_site()
|
||||
|
|
|
|||
|
|
@ -175,15 +175,13 @@ def normalize_query(query: str) -> str:
|
|||
|
||||
|
||||
def record(force=False):
|
||||
if __debug__:
|
||||
if frappe.cache.get_value(RECORDER_INTERCEPT_FLAG) or force:
|
||||
frappe.local._recorder = Recorder(force=force)
|
||||
if frappe.cache.get_value(RECORDER_INTERCEPT_FLAG) or force:
|
||||
frappe.local._recorder = Recorder(force=force)
|
||||
|
||||
|
||||
def dump():
|
||||
if __debug__:
|
||||
if hasattr(frappe.local, "_recorder"):
|
||||
frappe.local._recorder.dump()
|
||||
if hasattr(frappe.local, "_recorder"):
|
||||
frappe.local._recorder.dump()
|
||||
|
||||
|
||||
class Recorder:
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ from urllib.parse import parse_qs, urlparse
|
|||
|
||||
import cssutils
|
||||
import pdfkit
|
||||
|
||||
pdfkit.source.unicode = str # NOTE: upstream bug; PYTHONOPTIMIZE=1 optimized this away
|
||||
from bs4 import BeautifulSoup
|
||||
from packaging.version import Version
|
||||
from pypdf import PdfReader, PdfWriter
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue