test_ok2/testing/python
Ran Benita 98891a5947 python: skip pytest_pycollect_makeitem work on certain names
When a Python object (module/class/instance) is collected, for each name
in `obj.__dict__` (and up its MRO) the pytest_pycollect_makeitem hook is
called for potentially creating a node for it.

These Python objects have a bunch of builtin attributes that are
extremely unlikely to be collected. But due to their pervasiveness,
dispatching the hook for them ends up being mildly expensive and also
pollutes PYTEST_DEBUG=1 output and such.

Let's just ignore these attributes.

On the pandas test suite commit 04e9e0afd476b1b8bed930e47bf60e,
collect only, irrelevant lines snipped, about 5% improvement:

Before:

```
         51195095 function calls (48844352 primitive calls) in 39.089 seconds

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
226602/54    0.145    0.000   38.940    0.721 manager.py:90(_hookexec)
    72227    0.285    0.000   20.146    0.000 python.py:424(_makeitem)
    72227    0.171    0.000   16.678    0.000 python.py:218(pytest_pycollect_makeitem)
```

After:

```
          48410921 function calls (46240870 primitive calls) in 36.950 seconds

    ncalls  tottime  percall  cumtime  percall filename:lineno(function)
 181429/54    0.113    0.000   36.777    0.681 manager.py:90(_hookexec)
     27054    0.130    0.000   17.755    0.001 python.py:465(_makeitem)
     27054    0.121    0.000   16.219    0.001 python.py:218(pytest_pycollect_makeitem)
```
2020-08-26 17:43:57 +03:00
..
approx.py testing: fix some docstring issues 2020-08-03 10:10:43 +03:00
collect.py python: skip pytest_pycollect_makeitem work on certain names 2020-08-26 17:43:57 +03:00
fixtures.py Drop support for positional arguments in @pytest.fixture 2020-08-19 08:11:42 -03:00
integration.py typing: set no_implicit_reexport 2020-07-31 10:09:11 +03:00
metafunc.py python: fix empty parametrize() leading to "NotSetType.token" id 2020-08-25 22:01:43 +03:00
raises.py testing: fix some docstring issues 2020-08-03 10:10:43 +03:00
show_fixtures_per_test.py Use new no-match functions to replace previous idiom 2019-10-06 18:05:24 -03:00