Remove py version printing, traceback filtering, freezing
Not so important anymore, and makes it easier to remove the py dependency.
This commit is contained in:
@@ -1240,7 +1240,6 @@ _PLUGGY_DIR = Path(pluggy.__file__.rstrip("oc"))
|
||||
if _PLUGGY_DIR.name == "__init__.py":
|
||||
_PLUGGY_DIR = _PLUGGY_DIR.parent
|
||||
_PYTEST_DIR = Path(_pytest.__file__).parent
|
||||
_PY_DIR = Path(__import__("py").__file__).parent
|
||||
|
||||
|
||||
def filter_traceback(entry: TracebackEntry) -> bool:
|
||||
@@ -1268,7 +1267,5 @@ def filter_traceback(entry: TracebackEntry) -> bool:
|
||||
return False
|
||||
if _PYTEST_DIR in parents:
|
||||
return False
|
||||
if _PY_DIR in parents:
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
@@ -9,11 +9,9 @@ from typing import Union
|
||||
def freeze_includes() -> List[str]:
|
||||
"""Return a list of module names used by pytest that should be
|
||||
included by cx_freeze."""
|
||||
import py
|
||||
import _pytest
|
||||
|
||||
result = list(_iter_all_modules(py))
|
||||
result += list(_iter_all_modules(_pytest))
|
||||
result = list(_iter_all_modules(_pytest))
|
||||
return result
|
||||
|
||||
|
||||
|
||||
@@ -6,8 +6,6 @@ from typing import List
|
||||
from typing import Optional
|
||||
from typing import Union
|
||||
|
||||
import py
|
||||
|
||||
import pytest
|
||||
from _pytest.config import Config
|
||||
from _pytest.config import ExitCode
|
||||
@@ -108,11 +106,10 @@ def pytest_cmdline_parse():
|
||||
path = config.option.debug
|
||||
debugfile = open(path, "w")
|
||||
debugfile.write(
|
||||
"versions pytest-%s, py-%s, "
|
||||
"versions pytest-%s, "
|
||||
"python-%s\ncwd=%s\nargs=%s\n\n"
|
||||
% (
|
||||
pytest.__version__,
|
||||
py.__version__,
|
||||
".".join(map(str, sys.version_info)),
|
||||
os.getcwd(),
|
||||
config.invocation_params.args,
|
||||
@@ -249,7 +246,7 @@ def getpluginversioninfo(config: Config) -> List[str]:
|
||||
def pytest_report_header(config: Config) -> List[str]:
|
||||
lines = []
|
||||
if config.option.debug or config.option.traceconfig:
|
||||
lines.append(f"using: pytest-{pytest.__version__} pylib-{py.__version__}")
|
||||
lines.append(f"using: pytest-{pytest.__version__}")
|
||||
|
||||
verinfo = getpluginversioninfo(config)
|
||||
if verinfo:
|
||||
|
||||
@@ -29,7 +29,6 @@ from typing import Union
|
||||
|
||||
import attr
|
||||
import pluggy
|
||||
import py
|
||||
|
||||
import _pytest._version
|
||||
from _pytest import nodes
|
||||
@@ -704,8 +703,8 @@ class TerminalReporter:
|
||||
if pypy_version_info:
|
||||
verinfo = ".".join(map(str, pypy_version_info[:3]))
|
||||
msg += f"[pypy-{verinfo}-{pypy_version_info[3]}]"
|
||||
msg += ", pytest-{}, py-{}, pluggy-{}".format(
|
||||
_pytest._version.version, py.__version__, pluggy.__version__
|
||||
msg += ", pytest-{}, pluggy-{}".format(
|
||||
_pytest._version.version, pluggy.__version__
|
||||
)
|
||||
if (
|
||||
self.verbosity > 0
|
||||
|
||||
Reference in New Issue
Block a user