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:
Ran Benita
2021-10-16 01:57:12 +03:00
parent bc2f20722c
commit a3b69d9d83
8 changed files with 13 additions and 49 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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:

View File

@@ -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