test_ok2/_pytest
Allan Feldman 75f11f0b65 Fix reference cycle caused by PseudoFixtureDef.
Python types have reference cycles to themselves when they are created. This is
partially caused by descriptors which get / set values from the __dict__
attribute for getattr / setattr on classes.

This is not normally an issue since types tend to remain referenced for the
lifetime of the Python process (and thus never become garbage).

However, in the case of PseudoFixtureDef, the class is generated in
_get_active_fixturedef and later discarded when pytest_fixture_setup returns.
As a result, the generated PseudoFixtureDef type becomes garbage.

This is not really a performance issue but it can lead to some problems when
making tests and assertions about garbage when using pytest.

This garbage creation problem can be rectified by returning a namedtuple
instance which is functionally the same. In the modified code, the namedtuple
is allocated / deallocated using reference counting rather than having to use
the garbage collector.
2018-02-21 21:40:54 -08:00
..
_code Replace py.std with stdlib imports 2018-01-09 12:44:10 -08:00
assertion All classes now subclass object for better py3 compatibility 2018-01-24 18:23:42 -02:00
__init__.py fix import error 2017-04-26 15:57:55 +02:00
_argcomplete.py All classes now subclass object for better py3 compatibility 2018-01-24 18:23:42 -02:00
cacheprovider.py Replace deprecated option.getvalue by option.getoption in cacheprovider 2018-01-29 08:40:29 -02:00
capture.py All classes now subclass object for better py3 compatibility 2018-01-24 18:23:42 -02:00
compat.py Fix mock patchings detection when both mock and unittest.mock are present 2018-02-12 20:29:37 +01:00
config.py Merge pull request #3148 from nicoddemus/deprecate-old-style-classes-2147 2018-01-25 10:41:28 -02:00
debugging.py Merge pull request #3186 from brianmaissy/bugfix/print_captured_stdout_before_entering_pdb 2018-02-15 19:38:23 -02:00
deprecated.py Deprecate metafunc.addcall 2017-11-15 15:16:00 -02:00
doctest.py Probably it's best to write the err stream to stderr. 2018-02-17 12:13:33 -05:00
fixtures.py Fix reference cycle caused by PseudoFixtureDef. 2018-02-21 21:40:54 -08:00
freeze_support.py Fixed E303 flake8 errors 2017-07-17 01:44:23 +02:00
helpconfig.py Fix -o behavior to no longer swallow all remaining options 2018-01-23 21:19:16 -02:00
hookspec.py Merge remote-tracking branch 'upstream/master' into features 2018-01-27 12:28:43 -02:00
junitxml.py implement #3130 - adding record_xml_attribute fixture 2018-01-22 15:14:53 -08:00
logging.py Don't traceback on unkown sections. 2018-02-05 19:09:38 +00:00
main.py All classes now subclass object for better py3 compatibility 2018-01-24 18:23:42 -02:00
mark.py Merge branch 'master' into typo_for_parametrize 2018-01-30 16:22:54 -06:00
monkeypatch.py All classes now subclass object for better py3 compatibility 2018-01-24 18:23:42 -02:00
nodes.py port _Compatproperty to attrs 2017-12-18 11:08:20 +01:00
nose.py convert py module references to six module 2017-08-04 08:05:03 +05:30
outcomes.py Fix docstring alignment and typos 2017-10-02 21:24:52 -03:00
pastebin.py Revert making TerminalWriter public in TerminalReporter plugin 2017-11-23 19:53:12 -02:00
pytester.py All classes now subclass object for better py3 compatibility 2018-01-24 18:23:42 -02:00
python.py Merge branch 'master' into typo_for_parametrize 2018-01-30 16:22:54 -06:00
python_api.py Raise unexpected exceptions with pytest.raises() using match= 2018-02-15 12:11:56 +01:00
recwarn.py Fix additional linting issues 2017-10-24 21:01:00 -02:00
resultlog.py Fixed E302 flake8 errors 2017-07-17 01:44:23 +02:00
runner.py All classes now subclass object for better py3 compatibility 2018-01-24 18:23:42 -02:00
setuponly.py Refactor some names for better understanding and consistency 2017-09-26 20:09:42 -03:00
setupplan.py Add __future__ imports to all pytest modules 2017-03-16 22:45:40 -03:00
skipping.py Assume not skipped by mark if attribute missing 2018-01-03 18:47:18 -05:00
terminal.py All classes now subclass object for better py3 compatibility 2018-01-24 18:23:42 -02:00
tmpdir.py All classes now subclass object for better py3 compatibility 2018-01-24 18:23:42 -02:00
unittest.py Merge remote-tracking branch 'upstream/master' into merge-master-into-features 2017-11-10 18:33:02 -02:00
warnings.py Only escape str-like arguments passed to warnings 2017-11-27 23:17:15 -02:00