./devel/py-test, Python testing tool

[ CVSweb ] [ Homepage ] [ RSS ] [ Required by ] [ Add to tracker ]


Branch: CURRENT, Version: 4.4.1, Package name: py27-test-4.4.1, Maintainer: pkgsrc-users

The ``py.test`` testing tool makes it easy to write small tests, yet
scales to support complex functional testing. It provides
- auto-discovery of test modules and functions,
- detailed info on failing `assert statements
(no need to remember ``self.assert*`` names)
- modular fixtures for managing small or parametrized long-lived
test resources.
- multi-paradigm support: you can use ``py.test`` to run test suites based
on unittest (or trial), nose
- single-source compatibility to Python2.4 all the way up to Python3.3,
PyPy-1.9 and Jython-2.5.1.


Required to run:
[textproc/py-expat] [devel/py-setuptools] [lang/python27] [devel/py-py] [lang/py-six] [devel/py-more-itertools] [devel/py-atomicwrites] [devel/py-pluggy] [devel/py-funcsigs] [devel/py-attrs] [devel/py-pathlib2]

Required to build:
[pkgtools/cwrappers] [devel/py-setuptools_scm]

Master sites:

SHA1: 90456d876992292ad1afd326885ff402a0853f43
RMD160: efb4ccd7c2b0e469960cb35295b8ed6456f27864
Filesize: 909.556 KB

Version history: (Expand)


CVS history: (Expand)


   2019-04-16 09:17:07 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-test: updated to 4.4.1

pytest 4.4.1:
Bug Fixes
* Environment variables are properly restored when using pytester’s testdir \ 
fixture.
* Fix regression with --pdbcls, which stopped working with local modules in 4.0.0.
* Produce a warning when unknown keywords are passed to pytest.param(...).
* Invalidate import caches with monkeypatch.syspath_prepend, which is required \ 
with namespace packages being used.
   2019-04-02 11:43:52 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-test: updated to 4.4.0

pytest 4.4.0:

Features
* async test functions are skipped and a warning is emitted when a suitable \ 
async plugin is not installed (such as pytest-asyncio or pytest-trio).
Previously async functions would not execute at all but still be marked as \ 
“passed”.

* Include new \ 
disable_test_id_escaping_and_forfeit_all_rights_to_community_support option to \ 
disable ascii-escaping in parametrized values. This may cause a series of \ 
problems and as the name makes clear, use at your own risk.
* The -p option can now be used to early-load plugins also by entry-point name, \ 
instead of just by module name.
This makes it possible to early load external plugins like pytest-cov in the \ 
command-line:
pytest -p pytest_cov

* The --pdbcls option handles classes via module attributes now (e.g. \ 
pdb:pdb.Pdb with pdb++), and its validation was improved.
* The testpaths configuration option is now displayed next to the rootdir and \ 
inifile lines in the pytest header if the option is in effect, i.e., directories \ 
or file names were not explicitly passed in the command line.
Also, inifile is only displayed if there’s a configuration file, instead of an \ 
empty inifile: string.

* Doctests can be skipped now dynamically using pytest.skip().
* Internal refactorings have been made in order to make the implementation of \ 
the pytest-subtests plugin possible, which adds unittest sub-test support and a \ 
new subtests fixture as discussed in 1367.
For details on the internal refactorings, please see the details on the related PR.

* pytester’s LineMatcher asserts that the passed lines are a sequence.
* Handle -p plug after -p no:plug.
This can be used to override a blocked plugin (e.g. in “addopts”) from the \ 
command line etc.

* Output capturing is handled correctly when only capturing via fixtures \ 
(capsys, capfs) with pdb.set_trace().
* pytester sets $HOME and $USERPROFILE to the temporary directory during test runs.
This ensures to not load configuration files from the real user’s home directory.

* Namespace packages are handled better with monkeypatch.syspath_prepend and \ 
testdir.syspathinsert (via pkg_resources.fixup_namespace_packages).
* The stepwise plugin reports status information now.
* If a setup.cfg file contains [tool:pytest] and also the no longer supported \ 
[pytest] section, pytest will use [tool:pytest] ignoring [pytest]. Previously it \ 
would unconditionally error out.
This makes it simpler for plugins to support old pytest versions.

Bug Fixes
* Fix bug where fixtures requested dynamically via request.getfixturevalue() \ 
might be teardown before the requesting fixture.
* pytester unsets PYTEST_ADDOPTS now to not use outer options with \ 
testdir.runpytest().
* Use the correct modified time for years after 2038 in rewritten .pyc files.
* Fix line offsets with ScopeMismatch errors.
* -p no:plugin is handled correctly for default (internal) plugins now, e.g. \ 
with -p no:capture.
Previously they were loaded (imported) always, making e.g. the capfd fixture \ 
available.

* The pdb quit command is handled properly when used after the debug command \ 
with pdb++.
* Fix the interpretation of -qq option where it was being considered as -v instead.
* outcomes.Exit is not swallowed in assertrepr_compare anymore.
* Close logging’s file handler explicitly when the session finishes.
* Fix line offset with mark collection error (off by one).

Improved Documentation
* Update docs for pytest_cmdline_parse hook to note availability liminations
Trivial/Internal Changes
* pluggy>=0.9 is now required.
* funcsigs>=1.0 is now required for Python 2.7.
* Some left-over internal code related to yield tests has been removed.
* Remove internally unused anypython fixture from the pytester plugin.
* Remove deprecated Sphinx directive, add_description_unit(), pin \ 
sphinx-removed-in to >= 0.2.0 to support Sphinx 2.0.
* Fix pytest tests invocation with custom PYTHONPATH.
* New pytest_report_to_serializable and pytest_report_from_serializable \ 
experimental hooks.
These hooks will be used by pytest-xdist, pytest-subtests, and the replacement \ 
for resultlog to serialize and customize reports.
They are experimental, meaning that their details might change or even be \ 
removed completely in future patch releases without warning.

Feedback is welcome from plugin authors and users alike.

* Collector.repr_failure respects the --tb option, but only defaults to short \ 
now (with auto).
   2019-03-13 09:54:21 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-test: updated to 4.3.1

pytest 4.3.1:

Bug Fixes
- Logging messages inside pytest_runtest_logreport() are now properly captured \ 
and displayed.
- Improve validation of contents written to captured output so it behaves the \ 
same as when capture is disabled.
- Fix AttributeError: FixtureRequest has no 'confg' attribute bug in \ 
testdir.copy_example.

Trivial/Internal Changes
- Avoid pkg_resources import at the top-level.
   2019-02-19 09:25:49 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-test: updated to 4.3.0

pytest 4.3.0:

Deprecations
* pytest.warns() now emits a warning when it receives unknown keyword arguments.

This will be changed into an error in the future.

Features
* Usage errors from argparse are mapped to pytest’s UsageError.

* Add the --ignore-glob parameter to exclude test-modules with Unix shell-style \ 
wildcards. Add the collect_ignore_glob for conftest.py to exclude test-modules \ 
with Unix shell-style wildcards.

* The warning about Python 2.7 and 3.4 not being supported in pytest 5.0 has \ 
been removed.

In the end it was considered to be more of a nuisance than actual utility and \ 
users of those Python versions shouldn’t have problems as pip will not install \ 
pytest 5.0 on those interpreters.

* With the help of new set_log_path() method there is a way to set log_file \ 
paths from hooks.

Bug Fixes
* --help and --version are handled with UsageError.
* Fix AssertionError with collection of broken symlinks with packages.
   2019-02-13 16:40:53 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-test: updated to 4.2.1

pytest 4.2.1:

Bug Fixes
- The pytest_report_collectionfinish hook now is also called with --collect-only.
- Do not raise UsageError when an imported package has a pytest_plugins.py child \ 
module.
- Fix output capturing when using pdb++ with recursive debugging.
- Fix handling of collect_ignore via parent conftest.py.
- Fix regression where setUpClass would always be called in subclasses even if \ 
all tests
  were skipped by a unittest.skip() decorator applied in the subclass.
- Fix parametrize(... ids=<function>) when the function returns non-strings.
- Fix/improve collection of args when passing in __init__.py and a test file.
- more_itertools is now constrained to <6.0.0 when required for Python 2.7 \ 
compatibility.
- Fix "ValueError: Plugin already registered" exceptions when running \ 
in build directories that symlink to actual source.

Improved Documentation
- Add note to plugins.rst that pytest_plugins should not be used as a name for a \ 
user module containing plugins.
- Document how to use raises and does_not_raise to write parametrized tests with \ 
conditional raises.
- Document how to customize test failure messages when using
  pytest.warns.

Trivial/Internal Changes
- Some verbosity related attributes of the TerminalReporter plugin are now
  read only properties.
   2019-02-03 12:07:39 by Leonardo Taccari | Files touched by this commit (1)
Log message:
py-test: Remove not needed REPLACE_PYTHON (file no longer exists)
   2019-02-01 12:52:22 by Adam Ciarcinski | Files touched by this commit (3) | Package updated
Log message:
py-test: updated to 4.2.0

pytest 4.2.0:

Features
* Class xunit-style functions and methods now obey the scope of autouse fixtures.
This fixes a number of surprising issues like setup_method being called before \ 
session-scoped autouse fixtures.

* Display a message at the end of the test session when running under Python 2.7 \ 
and 3.4 that pytest 5.0 will no longer support those Python versions.
* The number of selected tests now are also displayed when the -k or -m flags \ 
are used.
* pytest_report_teststatus hook now can also receive a config parameter.
* pytest_terminal_summary hook now can also receive a config parameter.

Bug Fixes
* --junitxml can emit XML compatible with Jenkins xUnit. junit_family INI option \ 
accepts legacy|xunit1, which produces old style output, and xunit2 that conforms \ 
more strictly to \ 
https://github.com/jenkinsci/xunit-plug … nit-10.xsd
* Improve quitting from pdb, especially with --trace.
Using q[quit] after pdb.set_trace() will quit pytest also.

* Warning summary now groups warnings by message instead of by test id.
This makes the output more compact and better conveys the general idea of how \ 
much code is actually generating warnings, instead of how many tests call that \ 
code.

* monkeypatch.delattr handles class descriptors like staticmethod/classmethod.
* Restore marks being considered keywords for keyword expressions.
* tmp_path fixture and other related ones provides resolved path (a.k.a real path)
* pytest_terminal_summary uses result from pytest_report_teststatus hook, rather \ 
than hardcoded strings.
* Correctly handle unittest.SkipTest exception containing non-ascii characters \ 
on Python 2.
* Ensure the tmpdir and the tmp_path fixtures are the same folder.
* Ensure tmp_path is always a real path.

Trivial/Internal Changes
* Use a.item() instead of the deprecated np.asscalar(a) in pytest.approx.
np.asscalar has been deprecated in numpy 1.16..

* Copy saferepr from pylib
   2019-01-13 18:45:34 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-test: updated to 4.1.1

pytest 4.1.1:
Bug Fixes
* Show full repr with assert a==b and -vv.
* Extend Doctest-modules to ignore mock objects.
* Fixed pytest.warns bug when context manager is reused (e.g. multiple \ 
parametrization).
* Don’t rewrite assertion when __getattr__ is broken