8000 gh-127873: Only check `sys.flags.ignore_environment` for `PYTHON*` env vars by hugovk · Pull Request #127877 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-127873: Only check sys.flags.ignore_environment for PYTHON* env vars #127877

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
Revert some import sorting
  • Loading branch information
hugovk committed Jan 20, 2025
commit fbbce37bbf3a7170cecfc1881b30c9b6d41c847d
1 change: 1 addition & 0 deletions Lib/test/test_capi/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class InstanceMethod:

CURRENT_THREAD_REGEX = r'Current thread.*:\n' if not support.Py_GIL_DISABLED else r'Stack .*:\n'


@support.force_not_colorized_test_class
class CAPITest(unittest.TestCase):

Expand Down
9 changes: 2 additions & 7 deletions Lib/test/test_cmd_line_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@

import textwrap
from test import support
from test.support import (
force_not_colorized_test_class,
import_helper,
is_apple,
os_helper,
)
from test.support import import_helper, is_apple, os_helper
from test.support.script_helper import (
make_pkg, make_script, make_zip_pkg, make_zip_script,
assert_python_ok, assert_python_failure, spawn_python, kill_python)
Expand Down Expand Up @@ -94,7 +89,7 @@ def _make_test_zip_pkg(zip_dir, zip_basename, pkg_name, script_basename,
return to_return


@force_not_colorized_test_class
@support.force_not_colorized_test_class
class CmdLineTest(unittest.TestCase):
def _check_output(self, script_name, exit_code, data,
expected_file, expected_argv0,
Expand Down
3 changes: 1 addition & 2 deletions Lib/test/test_compileall.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
_have_multiprocessing = False

from test import support
from test.support import force_not_colorized
from test.support import os_helper
from test.support import script_helper
from test.test_py_compile import without_source_date_epoch
Expand Down Expand Up @@ -767,7 +766,7 @@ def test_d_compile_error(self):
rc, out, err = self.assertRunNotOK('-q', '-d', 'dinsdale', self.pkgdir)
self.assertRegex(out, b'File "dinsdale')

@force_not_colorized
@support.force_not_colorized
def test_d_runtime_error(self):
bazfn = script_helper.make_script(self.pkgdir, 'baz', 'raise Exception')
self.assertRunOK('-q', '-d', 'dinsdale', self.pkgdir)
Expand Down
18 changes: 6 additions & 12 deletions Lib/test/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,11 @@
from itertools import product
from textwrap import dedent

from test.support import (
SuppressCrashReport,
captured_stderr,
check_impl_detail,
cpython_only,
force_not_colorized,
force_not_colorized_test_class,
gc_collect,
no_tracing,
script_helper,
)
from test.support import (captured_stderr, check_impl_detail,
cpython_only, gc_collect,
no_tracing, script_helper,
SuppressCrashReport,
force_not_colorized)
from test.support.import_helper import import_module
from test.support.os_helper import TESTFN, unlink
from test.support.warnings_helper import check_warnings
Expand Down Expand Up @@ -2187,7 +2181,7 @@ def test_multiline_not_highlighted(self):
self.assertEqual(result[-len(expected):], expected)


@force_not_colorized_test_class
@support.force_not_colorized_test_class
class SyntaxErrorTests(unittest.TestCase):
maxDiff = None

Expand Down
15 changes: 5 additions & 10 deletions Lib/test/test_inspect/test_inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,13 @@
except ImportError:
ThreadPoolExecutor = None

from test.support import (
ALWAYS_EQ,
MISSING_C_DOCSTRINGS,
cpython_only,
force_not_colorized,
has_subprocess_support,
import_helper,
run_no_yield_async_fn,
)
from test.support import cpython_only, import_helper
from test.support import MISSING_C_DOCSTRINGS, ALWAYS_EQ
from test.support import run_no_yield_async_fn
from test.support.import_helper import DirsOnSysPath, ready_to_import
from test.support.os_helper import TESTFN, temp_cwd
from test.support.script_helper import assert_python_ok, assert_python_failure, kill_python
from test.support import has_subprocess_support
from test import support

from test.test_inspect import inspect_fodder as mod
Expand Down Expand Up @@ -891,7 +886,7 @@ def test_getsource_stdlib_decimal(self):
self.assertEqual(src.splitlines(True), lines)

class TestGetsourceInteractive(unittest.TestCase):
@force_not_colorized
@support.force_not_colorized
def test_getclasses_interactive(self):
# bpo-44648: simulate a REPL session;
# there is no `__file__` in the __main__ module
Expand Down
Loading
0