man-group / pytest-plugins

A grab-bag of nifty pytest plugins
MIT License
556 stars 82 forks source link

pytest-profiling 1.7.0: pytest is failing #185

Open kloczek opened 3 years ago

kloczek commented 3 years ago

I'm trying to package your module as rpm package. So I'm using typical in such case build, install and test cycle used on building package from non-root account:

May I ask for help because few units are failing:

```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-profiling-1.7.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-profiling-1.7.0-2.fc35.x86_64/usr/lib/python3.8/site-packages + /usr/bin/pytest -ra =========================================================================== test session starts ============================================================================ platform linux -- Python 3.8.11, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000) rootdir: /home/tkloczko/rpmbuild/BUILD/pytest-profiling-1.7.0, configfile: setup.cfg plugins: profiling-1.7.0, forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, aspectlib-1.5.2, toolbox-0.5, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, flaky-3.7.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, datadir-1.3.1, regressions-2.2.0, cases-3.6.3, xprocess-0.18.1, black-0.3.12, checkdocs-2.7.1, anyio-3.3.0, Faker-8.11.0, asyncio-0.15.1, trio-0.7.0, httpbin-1.0.0, subtests-0.5.0, isort-2.0.0, hypothesis-6.14.6 collected 14 items . F [ 7%] tests/integration/test_profile_integration.py EEEE [ 38%] tests/unit/test_profile.py ........ [100%] ================================================================================== ERRORS ================================================================================== ______________________________________________________________ ERROR at setup of test_profile_profiles_tests _______________________________________________________________ @pytest.yield_fixture(scope='session') def virtualenv(): with VirtualEnv() as venv: test_dir = resource_filename('pytest_profiling', 'tests/integration/profile') # HACK: pin more-itertools to 5.0.0 to keep tests working in PY27 as # as that's a py3 only release > venv.install_package('more-itertools==5.0.0') tests/integration/test_profile_integration.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/pytest_virtualenv.py:212: in install_package self.run(cmd, capture=False) /usr/lib/python3.8/site-packages/pytest_virtualenv.py:151: in run return super(VirtualEnv, self).run(args, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , cmd = '/tmp/tmpnhj6t1w6/.env/bin/python /tmp/tmpnhj6t1w6/.env/bin/easy_install -q more-itertools==5.0.0' capture = False, check_rc = True, cd = Path('/tmp/tmpnhj6t1w6'), shell = True kwargs = {'env': {'AR': '/usr/bin/gcc-ar', 'BASH_FUNC_which%%': '() { ( alias;\n eval ${which_declare} ) | /usr/bin/which --tt...es -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none', ...}} p = , out = None, _ = None err = CalledProcessError(2, '/tmp/tmpnhj6t1w6/.env/bin/python /tmp/tmpnhj6t1w6/.env/bin/easy_install -q more-itertools==5.0.0') def run(self, cmd, capture=False, check_rc=True, cd=None, shell=False, **kwargs): """ Run a command relative to a given directory, defaulting to the workspace root Parameters ---------- cmd : `str` or `list` Command string or list. Commands given as a string will be run in a subshell. capture : `bool` Capture and return output check_rc : `bool` Assert return code is zero cd : `str` Path to chdir to, defaults to workspace root """ if isinstance(cmd, string_types): shell = True else: # Some of the command components might be path objects or numbers cmd = [str(i) for i in cmd] if not cd: cd = self.workspace with cmdline.chdir(cd): log.debug("run: {0}".format(cmd)) if capture: p = subprocess.Popen(cmd, shell=shell, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **kwargs) else: p = subprocess.Popen(cmd, shell=shell, **kwargs) (out, _) = p.communicate() if out is not None and not isinstance(out, string_types): out = out.decode('utf-8') if self.debug and capture: log.debug("Stdout/stderr:") log.debug(out) if check_rc and p.returncode != 0: err = subprocess.CalledProcessError(p.returncode, cmd) err.output = out if capture and not self.debug: log.error("Stdout/stderr:") log.error(out) > raise err E subprocess.CalledProcessError: Command '/tmp/tmpnhj6t1w6/.env/bin/python /tmp/tmpnhj6t1w6/.env/bin/easy_install -q more-itertools==5.0.0' returned non-zero exit status 2. /usr/lib/python3.8/site-packages/pytest_shutil/workspace.py:132: CalledProcessError -------------------------------------------------------------------------- Captured stdout setup --------------------------------------------------------------------------- created virtual environment CPython3.8.11.final.0-64 in 290ms creator CPython3Posix(dest=/tmp/tmpnhj6t1w6/.env, clear=False, no_vcs_ignore=False, global=False) seeder FromAppData(extra_search_dir=/usr/lib64/python3.8/ensurepip/_bundled, /usr/share/python-wheels,download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/tkloczko/.local/share/virtualenv) added seed packages: pip==21.1.3, setuptools==57.0.0, wheel==0.36.2 activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator -------------------------------------------------------------------------- Captured stderr setup --------------------------------------------------------------------------- /tmp/tmpnhj6t1w6/.env/bin/python: can't open file '/tmp/tmpnhj6t1w6/.env/bin/easy_install': [Errno 2] No such file or directory _______________________________________________________________ ERROR at setup of test_profile_generates_svg _______________________________________________________________ @pytest.yield_fixture(scope='session') def virtualenv(): with VirtualEnv() as venv: test_dir = resource_filename('pytest_profiling', 'tests/integration/profile') # HACK: pin more-itertools to 5.0.0 to keep tests working in PY27 as # as that's a py3 only release > venv.install_package('more-itertools==5.0.0') tests/integration/test_profile_integration.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/pytest_virtualenv.py:212: in install_package self.run(cmd, capture=False) /usr/lib/python3.8/site-packages/pytest_virtualenv.py:151: in run return super(VirtualEnv, self).run(args, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , cmd = '/tmp/tmpnhj6t1w6/.env/bin/python /tmp/tmpnhj6t1w6/.env/bin/easy_install -q more-itertools==5.0.0' capture = False, check_rc = True, cd = Path('/tmp/tmpnhj6t1w6'), shell = True kwargs = {'env': {'AR': '/usr/bin/gcc-ar', 'BASH_FUNC_which%%': '() { ( alias;\n eval ${which_declare} ) | /usr/bin/which --tt...es -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none', ...}} p = , out = None, _ = None err = CalledProcessError(2, '/tmp/tmpnhj6t1w6/.env/bin/python /tmp/tmpnhj6t1w6/.env/bin/easy_install -q more-itertools==5.0.0') def run(self, cmd, capture=False, check_rc=True, cd=None, shell=False, **kwargs): """ Run a command relative to a given directory, defaulting to the workspace root Parameters ---------- cmd : `str` or `list` Command string or list. Commands given as a string will be run in a subshell. capture : `bool` Capture and return output check_rc : `bool` Assert return code is zero cd : `str` Path to chdir to, defaults to workspace root """ if isinstance(cmd, string_types): shell = True else: # Some of the command components might be path objects or numbers cmd = [str(i) for i in cmd] if not cd: cd = self.workspace with cmdline.chdir(cd): log.debug("run: {0}".format(cmd)) if capture: p = subprocess.Popen(cmd, shell=shell, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **kwargs) else: p = subprocess.Popen(cmd, shell=shell, **kwargs) (out, _) = p.communicate() if out is not None and not isinstance(out, string_types): out = out.decode('utf-8') if self.debug and capture: log.debug("Stdout/stderr:") log.debug(out) if check_rc and p.returncode != 0: err = subprocess.CalledProcessError(p.returncode, cmd) err.output = out if capture and not self.debug: log.error("Stdout/stderr:") log.error(out) > raise err E subprocess.CalledProcessError: Command '/tmp/tmpnhj6t1w6/.env/bin/python /tmp/tmpnhj6t1w6/.env/bin/easy_install -q more-itertools==5.0.0' returned non-zero exit status 2. /usr/lib/python3.8/site-packages/pytest_shutil/workspace.py:132: CalledProcessError _________________________________________________________________ ERROR at setup of test_profile_long_name _________________________________________________________________ @pytest.yield_fixture(scope='session') def virtualenv(): with VirtualEnv() as venv: test_dir = resource_filename('pytest_profiling', 'tests/integration/profile') # HACK: pin more-itertools to 5.0.0 to keep tests working in PY27 as # as that's a py3 only release > venv.install_package('more-itertools==5.0.0') tests/integration/test_profile_integration.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/pytest_virtualenv.py:212: in install_package self.run(cmd, capture=False) /usr/lib/python3.8/site-packages/pytest_virtualenv.py:151: in run return super(VirtualEnv, self).run(args, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , cmd = '/tmp/tmpnhj6t1w6/.env/bin/python /tmp/tmpnhj6t1w6/.env/bin/easy_install -q more-itertools==5.0.0' capture = False, check_rc = True, cd = Path('/tmp/tmpnhj6t1w6'), shell = True kwargs = {'env': {'AR': '/usr/bin/gcc-ar', 'BASH_FUNC_which%%': '() { ( alias;\n eval ${which_declare} ) | /usr/bin/which --tt...es -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none', ...}} p = , out = None, _ = None err = CalledProcessError(2, '/tmp/tmpnhj6t1w6/.env/bin/python /tmp/tmpnhj6t1w6/.env/bin/easy_install -q more-itertools==5.0.0') def run(self, cmd, capture=False, check_rc=True, cd=None, shell=False, **kwargs): """ Run a command relative to a given directory, defaulting to the workspace root Parameters ---------- cmd : `str` or `list` Command string or list. Commands given as a string will be run in a subshell. capture : `bool` Capture and return output check_rc : `bool` Assert return code is zero cd : `str` Path to chdir to, defaults to workspace root """ if isinstance(cmd, string_types): shell = True else: # Some of the command components might be path objects or numbers cmd = [str(i) for i in cmd] if not cd: cd = self.workspace with cmdline.chdir(cd): log.debug("run: {0}".format(cmd)) if capture: p = subprocess.Popen(cmd, shell=shell, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **kwargs) else: p = subprocess.Popen(cmd, shell=shell, **kwargs) (out, _) = p.communicate() if out is not None and not isinstance(out, string_types): out = out.decode('utf-8') if self.debug and capture: log.debug("Stdout/stderr:") log.debug(out) if check_rc and p.returncode != 0: err = subprocess.CalledProcessError(p.returncode, cmd) err.output = out if capture and not self.debug: log.error("Stdout/stderr:") log.error(out) > raise err E subprocess.CalledProcessError: Command '/tmp/tmpnhj6t1w6/.env/bin/python /tmp/tmpnhj6t1w6/.env/bin/easy_install -q more-itertools==5.0.0' returned non-zero exit status 2. /usr/lib/python3.8/site-packages/pytest_shutil/workspace.py:132: CalledProcessError ___________________________________________________________________ ERROR at setup of test_profile_chdir ___________________________________________________________________ @pytest.yield_fixture(scope='session') def virtualenv(): with VirtualEnv() as venv: test_dir = resource_filename('pytest_profiling', 'tests/integration/profile') # HACK: pin more-itertools to 5.0.0 to keep tests working in PY27 as # as that's a py3 only release > venv.install_package('more-itertools==5.0.0') tests/integration/test_profile_integration.py:17: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.8/site-packages/pytest_virtualenv.py:212: in install_package self.run(cmd, capture=False) /usr/lib/python3.8/site-packages/pytest_virtualenv.py:151: in run return super(VirtualEnv, self).run(args, **kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = , cmd = '/tmp/tmpnhj6t1w6/.env/bin/python /tmp/tmpnhj6t1w6/.env/bin/easy_install -q more-itertools==5.0.0' capture = False, check_rc = True, cd = Path('/tmp/tmpnhj6t1w6'), shell = True kwargs = {'env': {'AR': '/usr/bin/gcc-ar', 'BASH_FUNC_which%%': '() { ( alias;\n eval ${which_declare} ) | /usr/bin/which --tt...es -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -flto=auto -flto-partition=none', ...}} p = , out = None, _ = None err = CalledProcessError(2, '/tmp/tmpnhj6t1w6/.env/bin/python /tmp/tmpnhj6t1w6/.env/bin/easy_install -q more-itertools==5.0.0') def run(self, cmd, capture=False, check_rc=True, cd=None, shell=False, **kwargs): """ Run a command relative to a given directory, defaulting to the workspace root Parameters ---------- cmd : `str` or `list` Command string or list. Commands given as a string will be run in a subshell. capture : `bool` Capture and return output check_rc : `bool` Assert return code is zero cd : `str` Path to chdir to, defaults to workspace root """ if isinstance(cmd, string_types): shell = True else: # Some of the command components might be path objects or numbers cmd = [str(i) for i in cmd] if not cd: cd = self.workspace with cmdline.chdir(cd): log.debug("run: {0}".format(cmd)) if capture: p = subprocess.Popen(cmd, shell=shell, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **kwargs) else: p = subprocess.Popen(cmd, shell=shell, **kwargs) (out, _) = p.communicate() if out is not None and not isinstance(out, string_types): out = out.decode('utf-8') if self.debug and capture: log.debug("Stdout/stderr:") log.debug(out) if check_rc and p.returncode != 0: err = subprocess.CalledProcessError(p.returncode, cmd) err.output = out if capture and not self.debug: log.error("Stdout/stderr:") log.error(out) > raise err E subprocess.CalledProcessError: Command '/tmp/tmpnhj6t1w6/.env/bin/python /tmp/tmpnhj6t1w6/.env/bin/easy_install -q more-itertools==5.0.0' returned non-zero exit status 2. /usr/lib/python3.8/site-packages/pytest_shutil/workspace.py:132: CalledProcessError ================================================================================= FAILURES ================================================================================= _______________________________________________________________________________ test session _______________________________________________________________________________ cls = , func = . at 0x7f6ffc82d430>, when = 'call' reraise = (, ) @classmethod def from_call( cls, func: "Callable[[], TResult]", when: "Literal['collect', 'setup', 'call', 'teardown']", reraise: Optional[ Union[Type[BaseException], Tuple[Type[BaseException], ...]] ] = None, ) -> "CallInfo[TResult]": excinfo = None start = timing.time() precise_start = timing.perf_counter() try: > result: Optional[TResult] = func() /usr/lib/python3.8/site-packages/_pytest/runner.py:311: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > lambda: ihook(item=item, **kwds), when=when, reraise=reraise ) /usr/lib/python3.8/site-packages/_pytest/runner.py:255: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'>, args = (), kwargs = {'item': }, notincall = set() def __call__(self, *args, **kwargs): if args: raise TypeError("hook calling supports only keyword arguments") assert not self.is_historic() if self.spec and self.spec.argnames: notincall = ( set(self.spec.argnames) - set(["__multicall__"]) - set(kwargs.keys()) ) if notincall: warnings.warn( "Argument(s) {} which are declared in the hookspec " "can not be found in this hook call".format(tuple(notincall)), stacklevel=2, ) > return self._hookexec(self, self.get_hookimpls(), kwargs) /usr/lib/python3.8/site-packages/pluggy/hooks.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0x7f701cbec7c0>, hook = <_HookCaller 'pytest_runtest_call'> methods = [> _state='suspended' _in_suspended=False> _capture_fixture=None>>, ...] kwargs = {'item': } def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) /usr/lib/python3.8/site-packages/pluggy/manager.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [> _state='suspended' _in_suspended=False> _capture_fixture=None>>, ...] kwargs = {'item': } > self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall( methods, kwargs, firstresult=hook.spec.opts.get("firstresult") if hook.spec else False, ) /usr/lib/python3.8/site-packages/pluggy/manager.py:84: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook_impls = [> _state='suspended' _in_suspended=False> _capture_fixture=None>>, ...] caller_kwargs = {'item': }, firstresult = False def _multicall(hook_impls, caller_kwargs, firstresult=False): """Execute a call into multiple python functions/methods and return the result(s). ``caller_kwargs`` comes from _HookCaller.__call__(). """ __tracebackhide__ = True results = [] excinfo = None try: # run impl and wrapper setup functions in a loop teardowns = [] try: for hook_impl in reversed(hook_impls): try: args = [caller_kwargs[argname] for argname in hook_impl.argnames] except KeyError: for argname in hook_impl.argnames: if argname not in caller_kwargs: raise HookCallError( "hook call must provide argument %r" % (argname,) ) if hook_impl.hookwrapper: try: gen = hook_impl.function(*args) next(gen) # first yield teardowns.append(gen) except StopIteration: _raise_wrapfail(gen, "did not yield") else: res = hook_impl.function(*args) if res is not None: results.append(res) if firstresult: # halt further impl calls break except BaseException: excinfo = sys.exc_info() finally: if firstresult: # first result hooks return a single value outcome = _Result(results[0] if results else None, excinfo) else: outcome = _Result(results, excinfo) # run all wrapper post-yield blocks for gen in reversed(teardowns): try: gen.send(outcome) _raise_wrapfail(gen, "has second yield") except StopIteration: pass > return outcome.get_result() /usr/lib/python3.8/site-packages/pluggy/callers.py:208: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def get_result(self): """Get the result(s) for this hook call. If the hook was marked as a ``firstresult`` only a single value will be returned otherwise a list of results. """ __tracebackhide__ = True if self._excinfo is None: return self._result else: ex = self._excinfo if _py3: > raise ex[1].with_traceback(ex[2]) /usr/lib/python3.8/site-packages/pluggy/callers.py:80: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook_impls = [> _state='suspended' _in_suspended=False> _capture_fixture=None>>, ...] caller_kwargs = {'item': }, firstresult = False def _multicall(hook_impls, caller_kwargs, firstresult=False): """Execute a call into multiple python functions/methods and return the result(s). ``caller_kwargs`` comes from _HookCaller.__call__(). """ __tracebackhide__ = True results = [] excinfo = None try: # run impl and wrapper setup functions in a loop teardowns = [] try: for hook_impl in reversed(hook_impls): try: args = [caller_kwargs[argname] for argname in hook_impl.argnames] except KeyError: for argname in hook_impl.argnames: if argname not in caller_kwargs: raise HookCallError( "hook call must provide argument %r" % (argname,) ) if hook_impl.hookwrapper: try: gen = hook_impl.function(*args) next(gen) # first yield teardowns.append(gen) except StopIteration: _raise_wrapfail(gen, "did not yield") else: > res = hook_impl.function(*args) /usr/lib/python3.8/site-packages/pluggy/callers.py:187: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = def pytest_runtest_call(item: Item) -> None: _update_current_test_var(item, "call") try: del sys.last_type del sys.last_value del sys.last_traceback except AttributeError: pass try: item.runtest() except Exception as e: # Store trace info to allow postmortem debugging sys.last_type = type(e) sys.last_value = e assert e.__traceback__ is not None # Skip *this* frame sys.last_traceback = e.__traceback__.tb_next > raise e /usr/lib/python3.8/site-packages/_pytest/runner.py:170: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = def pytest_runtest_call(item: Item) -> None: _update_current_test_var(item, "call") try: del sys.last_type del sys.last_value del sys.last_traceback except AttributeError: pass try: > item.runtest() /usr/lib/python3.8/site-packages/_pytest/runner.py:162: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = def runtest(self): desc = self.get_long_description() method_name = f"run_{re.sub('[-/]', '_', desc.content_type)}" > getattr(self, method_name)(desc) /usr/lib/python3.8/site-packages/pytest_checkdocs/__init__.py:42: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = desc = '# Pytest Profiling Plugin\n\nProfiling plugin for pytest, with tabular and heat graph output.\n\nTests are profiled w...args\n\n### 1.0.1 (2015-12-23)\n\n * Packaging bugfix\n\n### 1.0.0 (2015-12-21)\n\n * Initial public release\n\n\n\n' def run_text_x_rst(self, desc): with self.monkey_patch_system_message() as reports: self.rst2html(desc) > assert not reports E AssertionError: assert not ['Unexpected indentation.', 'Inline literal start-string without end-string.', 'Inline interpreted text or phrase refe...start-string without end-string.', 'Inline interpreted text or phrase reference start-string without end-string.', ...] /usr/lib/python3.8/site-packages/pytest_checkdocs/__init__.py:50: AssertionError --------------------------------------------------------------------------- Captured stderr call --------------------------------------------------------------------------- :15: (ERROR/3) Unexpected indentation. :13: (WARNING/2) Inline literal start-string without end-string. :13: (WARNING/2) Inline interpreted text or phrase reference start-string without end-string. :18: (WARNING/2) Block quote ends without a blank line; unexpected unindent. :18: (WARNING/2) Inline literal start-string without end-string. :18: (WARNING/2) Inline interpreted text or phrase reference start-string without end-string. :22: (WARNING/2) Inline literal start-string without end-string. :22: (WARNING/2) Inline interpreted text or phrase reference start-string without end-string. :24: (WARNING/2) Definition list ends without a blank line; unexpected unindent. :24: (WARNING/2) Inline literal start-string without end-string. :24: (WARNING/2) Inline interpreted text or phrase reference start-string without end-string. :35: (WARNING/2) Inline literal start-string without end-string. :35: (WARNING/2) Inline interpreted text or phrase reference start-string without end-string. :33: (ERROR/3) Unexpected indentation. :37: (WARNING/2) Definition list ends without a blank line; unexpected unindent. :37: (WARNING/2) Inline literal start-string without end-string. :37: (WARNING/2) Inline interpreted text or phrase reference start-string without end-string. :79: (WARNING/2) Inline literal start-string without end-string. :79: (WARNING/2) Inline interpreted text or phrase reference start-string without end-string. :59: (WARNING/2) Block quote ends without a blank line; unexpected unindent. :70: (WARNING/2) Block quote ends without a blank line; unexpected unindent. :81: (WARNING/2) Definition list ends without a blank line; unexpected unindent. :81: (WARNING/2) Inline literal start-string without end-string. :81: (WARNING/2) Inline interpreted text or phrase reference start-string without end-string. :89: (WARNING/2) Inline literal start-string without end-string. :89: (WARNING/2) Inline interpreted text or phrase reference start-string without end-string. :91: (WARNING/2) Definition list ends without a blank line; unexpected unindent. :91: (WARNING/2) Inline literal start-string without end-string. :91: (WARNING/2) Inline interpreted text or phrase reference start-string without end-string. :99: (WARNING/2) Inline literal start-string without end-string. :99: (WARNING/2) Inline interpreted text or phrase reference start-string without end-string. :101: (WARNING/2) Definition list ends without a blank line; unexpected unindent. :101: (WARNING/2) Inline literal start-string without end-string. :101: (WARNING/2) Inline interpreted text or phrase reference start-string without end-string. :107: (WARNING/2) Inline literal start-string without end-string. :107: (WARNING/2) Inline interpreted text or phrase reference start-string without end-string. :109: (WARNING/2) Definition list ends without a blank line; unexpected unindent. :109: (WARNING/2) Inline literal start-string without end-string. :109: (WARNING/2) Inline interpreted text or phrase reference start-string without end-string. :127: (WARNING/2) Inline emphasis start-string without end-string. ============================================================================= warnings summary ============================================================================= tests/integration/test_profile_integration.py:9 /home/tkloczko/rpmbuild/BUILD/pytest-profiling-1.7.0/tests/integration/test_profile_integration.py:9: PytestDeprecationWarning: @pytest.yield_fixture is deprecated. Use @pytest.fixture instead; they are the same. @pytest.yield_fixture(scope='session') ../../BUILDROOT/python-pytest-profiling-1.7.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/pytest_profiling.py:20 /home/tkloczko/rpmbuild/BUILDROOT/python-pytest-profiling-1.7.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/pytest_profiling.py:20: DeprecationWarning: invalid escape sequence \: forbidden_chars = set('/?<>\:*|"') -- Docs: https://docs.pytest.org/en/stable/warnings.html ========================================================================= short test summary info ========================================================================== ERROR tests/integration/test_profile_integration.py::test_profile_profiles_tests - subprocess.CalledProcessError: Command '/tmp/tmpnhj6t1w6/.env/bin/python /tmp/tmpnhj6t... ERROR tests/integration/test_profile_integration.py::test_profile_generates_svg - subprocess.CalledProcessError: Command '/tmp/tmpnhj6t1w6/.env/bin/python /tmp/tmpnhj6t1... ERROR tests/integration/test_profile_integration.py::test_profile_long_name - subprocess.CalledProcessError: Command '/tmp/tmpnhj6t1w6/.env/bin/python /tmp/tmpnhj6t1w6/.... ERROR tests/integration/test_profile_integration.py::test_profile_chdir - subprocess.CalledProcessError: Command '/tmp/tmpnhj6t1w6/.env/bin/python /tmp/tmpnhj6t1w6/.env/... FAILED ::project - AssertionError: assert not ['Unexpected indentation.', 'Inline literal start-string without end-string.', 'Inline interpreted text or phrase refe...st... ============================================================ 1 failed, 8 passed, 2 warnings, 4 errors in 7.23s ============================================================= pytest-xprocess reminder::Be sure to terminate the started process by running 'pytest --xkill' if you have not explicitly done so in your fixture with 'xprocess.getinfo().terminate()'. ```
eeaston commented 2 years ago

Hi there, this looks like an issue with python2 compatibility which we will shortly be dropping - I'll let you know when it's released and you can check again if it's still a problem.

kloczek commented 2 years ago

Other thing was pinning more-itertools version solved in 6e2d3e58. I think that it would be good to make new release of the pytest plugins because currently many known issues already have been resolved and merged to the git repo.

SteveHespelt commented 2 years ago

I was making some changes to the pytest-profiling plugin & ran into this issue too. It's because, per the setuptools' v52.0 change, the easy_install entrypoint is no longer installed. I started making serious changes to pytest-virtualenv before I realized a potential hack might be available. Sure enough, if I change the pkg_name arguments of the test_profile_intergration.py's usage of VirtualEnv.install_package() to use 'install ' as a prefix, specify installer='pip' rather than the default 'easy_install', then the install_package will successfully install requested packages need by the tests. That is,

venv.install_package("install more-itertools", installer='pip')
...
venv.install_package("install 'pytest-profiling>1.7.1' ", installer='pip' ) # <- my locally built 1.7.2, uploaded wheel 

For my locally developed profiling wheel, I built the wheel, uploaded to a devpi index, then prior to running the integration tests, defined PIP_EXTRA_INDEX_URL to point the test process to that index. It works with pytest-virtualenv 1.7.0. Lucky hack. And it, of course, forces every requested package to be installed from an index, bypassing the develop mode installs. That's why I had to use the local devpi index.

kloczek commented 2 years ago

Any chance to make new release of those modules? Last one was in 2019 ..

SteveHespelt commented 2 years ago

Hi Tomas, I've got some local changes to the pytest-profiling plugin (my recent fork.) The changes add a number of options for controlling the use of the pstats.Stats methods, options for providing the ordered list of restrictions. And options to pass through gprof2dot options.

I've added unit & integration tests for these changes as well. We've been using the changes (1.7.2?) for several weeks now with no issues encountered.

I'll submit the PR either today or tomorrow. -Steve Hespelt

From: Tomasz Kłoczko @.> Sent: Thursday, April 7, 2022 7:41 AM To: man-group/pytest-plugins @.> Cc: Steven Hespelt @.>; Comment @.> Subject: Re: [man-group/pytest-plugins] pytest-profiling 1.7.0: pytest is failing (#185)

CAUTION: This email originated from outside the organization. Please do not click links or open attachments unless you recognize the sender and know the content is safe.

Any chance to make new release of those modules? Last one was in 2019 ..

- Reply to this email directly, view it on GitHubhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fman-group%2Fpytest-plugins%2Fissues%2F185%23issuecomment-1091632118&data=04%7C01%7Cshespelt%40stevens.edu%7Ce14eaf809c904999625c08da188b8427%7C8d1a69ec03b54345ae21dad112f5fb4f%7C0%7C0%7C637849284753690618%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=Kc8srbUnkfaJJggyb6xWU%2BPq5b6uSQ78j1sDWfFKjG8%3D&reserved=0, or unsubscribehttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAJ6EXXF5RJT7QR7IF5WIGW3VD3CVPANCNFSM5B2YVYZQ&data=04%7C01%7Cshespelt%40stevens.edu%7Ce14eaf809c904999625c08da188b8427%7C8d1a69ec03b54345ae21dad112f5fb4f%7C0%7C0%7C637849284753690618%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=SHf26yI2BoAl858wuGQhwrlXoLWn01IvWcIy8SDbjyA%3D&reserved=0. You are receiving this because you commented.Message ID: @.**@.>>

kloczek commented 2 years ago

OK .. please let me know when tose PRs will be added. I'll be glad to help test that 😄

SteveHespelt commented 2 years ago

Hi Tomas, Sorry for the delay, probably a few more days – I’ve been ill the past 4-5 days. Turns out, I’m not that special after all… As soon as I can trust my brain for more than a few minutes, I’ll add the PR. -Steve

From: Tomasz Kłoczko @.> Sent: Saturday, April 9, 2022 10:32 AM To: man-group/pytest-plugins @.> Cc: Steven Hespelt @.>; Comment @.> Subject: Re: [man-group/pytest-plugins] pytest-profiling 1.7.0: pytest is failing (#185)

CAUTION: This email originated from outside the organization. Please do not click links or open attachments unless you recognize the sender and know the content is safe.

OK .. please let me know when tose PRs will be added. I'll be glad to help test that 😄

— Reply to this email directly, view it on GitHubhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fman-group%2Fpytest-plugins%2Fissues%2F185%23issuecomment-1094044146&data=04%7C01%7Cshespelt%40stevens.edu%7C8b7fb9ec847b49e6f6e008da1a35b928%7C8d1a69ec03b54345ae21dad112f5fb4f%7C0%7C0%7C637851115305698886%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=txlFu8xqVzJq00W6v0cXvjaebMAkTD%2BhAKC8GVeqAQk%3D&reserved=0, or unsubscribehttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAJ6EXXBBOCKQMUMAU6IZSB3VEGIGNANCNFSM5B2YVYZQ&data=04%7C01%7Cshespelt%40stevens.edu%7C8b7fb9ec847b49e6f6e008da1a35b928%7C8d1a69ec03b54345ae21dad112f5fb4f%7C0%7C0%7C637851115305698886%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=CvPBxwGbV0wj6sJtuKmi4Rp8iOdAFcQg4krdjJxIytE%3D&reserved=0. You are receiving this because you commented.Message ID: @.**@.>>

kloczek commented 1 year ago

Gentle ping .. any update? 😋 Looking on https://github.com/man-group/pytest-plugins/compare/v1.7.0...master I see 100 commits since last release which was in 2019. Any plans to release new version?🤔