./devel/py-test, Python testing tool

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

Branch: CURRENT, Version: 3.5.0, Package name: py27-test-3.5.0, 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-pluggy] [devel/py-funcsigs] [devel/py-attrs]

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

Master sites:

SHA1: ebb431b74c018005d9298af34660c3f186235ccc
RMD160: ccf66ab8ba7125e7c565af48a8e4b6cd812470d7
Filesize: 811.344 KB

Version history: (Expand)

CVS history: (Expand)

   2018-03-23 09:58:00 by Adam Ciarcinski | Files touched by this commit (3) | Package updated
Log message:
py-test: updated to 3.5.0

Deprecations and Removals
record_xml_property fixture is now deprecated in favor of the more generic \ 
Defining pytest_plugins is now deprecated in non-top-level conftest.py files, \ 
because they “leak” to the entire directory tree.

New --show-capture command-line option that allows to specify how to display \ 
captured output when tests fail: no, stdout, stderr, log or all
New --rootdir command-line option to override the rules for discovering the root \ 
directory. See customize in the documentation for details.
Fixtures are now instantiated based on their scopes, with higher-scoped fixtures
record_xml_property renamed to record_property and is now compatible with xdist, \ 
markers and any reporter. record_xml_property name is now deprecated.
New --nf, --new-first options: run new tests first followed by the rest of the \ 
tests, in both cases tests are also sorted by the file modified time, with more \ 
recent files coming first.
New --last-failed-no-failures command-line option that allows to specify the \ 
behavior of the cache plugin’s `--last-failed feature when no tests failed in \ 
the last run
New --doctest-continue-on-failure command-line option to enable doctests to show \ 
multiple failures for each snippet, instead of stopping at the first failure.
Captured log messages are added to the <system-out> tag in the generated \ 
junit xml file if the junit_logging ini option is set to system-out. If the \ 
value of this ini option is system-err`, the logs are written to \ 
``<system-err>. The default value for junit_logging is no, meaning \ 
captured logs are not written to the output file.
Allow the logging plugin to handle pytest_runtest_logstart and \ 
pytest_runtest_logfinish hooks when live logs are enabled.
Passing –log-cli-level in the command-line now automatically activates live \ 
Add command line option --deselect to allow deselection of individual tests at \ 
collection time.
Captured logs are printed before entering pdb.
Deselected item count is now shown before tests are run, e.g. collected X items \ 
/ Y deselected.
The builtin module platform is now available for use in expressions in pytest.mark.
The short test summary info section now is displayed after tracebacks and \ 
warnings in the terminal.
New --verbosity flag to set verbosity level explicitly.
pytest.approx now accepts comparing a numpy array with a scalar.

Bug Fixes
Suppress IOError when closing the temporary file used for capturing streams in \ 
Python 2.7.
Fixed clear() method on caplog fixture which cleared records, but not the text \ 
During test collection, when stdin is not allowed to be read, the \ 
DontReadFromStdin object still allow itself to be iterable and resolved to an \ 
iterator without crashing.

Improved Documentation
Added a reference page to the docs.

Trivial/Internal Changes
Change minimum requirement of attrs to 17.4.0.
Renamed example directories so all tests pass when ran from the base directory.
Internal mark.py module has been turned into a package.
pytest now depends on the more_itertools package.
Added warning when [pytest] section is used in a .cfg file passed with -c
nodeids can now be passed explicitly to FSCollector and Node constructors.
Internal refactoring of FormattedExcinfo to use attrs facilities and remove old \ 
support code for legacy Python versions.
Refactoring to unify how verbosity is handled internally.
Internal refactoring to better integrate with argparse.
Fix a python example when calling a fixture in doc/en/usage.rst
   2018-03-06 09:33:36 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-test: updated to 3.4.2

Pytest 3.4.2:

Bug Fixes
Removed progress information when capture option is no.
Refactor check of bindir from exists to isdir.
Fix TypeError issue when using approx with a Decimal value.
Fix reference cycle generated when using the request fixture.
[tool:pytest] sections in *.cfg files passed by the -c option are now properly \ 

Improved Documentation
Add logging plugin to plugins list.

Trivial/Internal Changes
Fix minor typo in fixture.rst
   2018-02-22 10:34:09 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-test: updated to 3.4.1

Pytest 3.4.1

Bug Fixes
Move import of doctest.UnexpectedException to top-level to avoid possible errors \ 
when using --pdb.
Added printing of captured stdout/stderr before entering pdb, and improved a \ 
test which was giving false negatives about output capturing.
Fix ordering of tests using parametrized fixtures which can lead to fixtures \ 
being created more than necessary.
Fix bug where logging happening at hooks outside of "test run" hooks \ 
would cause an internal error.
Detect arguments injected by unittest.mock.patch decorator correctly when pypi \ 
mock.patch is installed and imported.
Errors shown when a pytest.raises() with match= fails are now cleaner on what \ 
happened: When no exception was raised, the "matching '...'" part got \ 
removed as it falsely implies that an exception was raised but it didn't match. \ 
When a wrong exception was raised, it's now thrown
Fixed output capture handling in doctests on macOS.

Improved Documentation
Add Sphinx parameter docs for match and message args to pytest.raises.

Trivial/Internal Changes
pytest has changed the publication procedure and is now being published to PyPI \ 
directly from Travis.
Rename ParameterSet._for_parameterize() to _for_parametrize() in order to comply \ 
with the naming convention.
Skip failing pdb/doctest test on mac.
   2018-02-02 12:53:22 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-test: updated to 3.4.0

Pytest 3.4.0

Deprecations and Removals
- All pytest classes now subclass object for better Python 2/3 compatibility.
  This should not affect user code except in very rare edge cases.

- Introduce empty_parameter_set_mark ini option to select which mark to
  apply when @pytest.mark.parametrize is given an empty set of parameters.
  Valid options are skip (default) and xfail. Note that it is planned
  to change the default to xfail in future releases as this is considered
  less error prone.
- **Incompatible change**: after community feedback the logging
  <https://docs.pytest.org/en/latest/logging.html>_ functionality has
  undergone some changes. Please consult the logging documentation
  for details.
- Console output falls back to "classic" mode when capturing is \ 
disabled (-s),
  otherwise the output gets garbled to the point of being useless.
- New pytest_runtest_logfinish
  hook which is called when a test item has finished executing, analogous to
- Improve performance when collecting tests using many fixtures.
- New caplog.get_records(when) method which provides access to the captured
  records for the "setup", "call" and "teardown"
  testing stages.
- New fixture record_xml_attribute that allows modifying and inserting
  attributes on the <testcase> xml node in JUnit reports.
- The default cache directory has been renamed from .cache to
  .pytest_cache after community feedback that the name .cache did not
  make it clear that it was used by pytest.
- Colorize the levelname column in the live-log output.

Bug Fixes
- Fix hanging pexpect test on MacOS by using flush() instead of wait().
- Fix restoring Python state after in-process pytest runs with the
  pytester plugin; this may break tests using multiple inprocess
  pytest runs if later ones depend on earlier ones leaking global interpreter
- Fix skipping plugin reporting hook when test aborted before plugin setup
- Fix progress percentage reported when tests fail during teardown.
- **Incompatible change**: -o/--override option no longer eats all the
  remaining options, which can lead to surprising behavior: for example,
  pytest -o foo=1 /path/to/test.py would fail because /path/to/test.py
  would be considered as part of the -o command-line argument. One
  consequence of this is that now multiple configuration overrides need
  multiple -o flags: pytest -o foo=1 -o bar=2.
   2018-01-05 16:28:37 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-test: updated to 3.3.2

Pytest 3.3.2:

Bug Fixes
- pytester: ignore files used to obtain current user metadata in the fd leak
- Fix **memory leak** where objects returned by fixtures were never destructed
  by the garbage collector.
- Fix conversion of pyargs to filename to not convert symlinks and not use
  deprecated features on Python 3.
- PYTEST_DONT_REWRITE is now checked for plugins too rather than only for
  test modules.

Improved Documentation
- Add clarifying note about behavior of multiple parametrized arguments

Trivial/Internal Changes
- Code cleanup.
- Clean up code by replacing imports and references of _ast to ast.
   2017-12-06 12:49:14 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-test: updated to 3.3.1

Pytest 3.3.1:

Bug Fixes
* Fix issue about -p no:<plugin> having no effect.
* Fix regression with warnings that contained non-strings in their arguments in \ 
Python 2.
* Always escape null bytes when setting PYTEST_CURRENT_TEST.
* Fix ZeroDivisionError when using the testmon plugin when no tests were \ 
actually collected.
* Bring back TerminalReporter.writer as an alias to TerminalReporter._tw. This \ 
alias was removed by accident in the 3.3.0 release.
* The pytest-capturelog plugin is now also blacklisted, avoiding errors when \ 
running pytest with it still installed.

Improved Documentation
* Fix broken link to plugin pytest-localserver.
   2017-11-28 10:04:56 by Adam Ciarcinski | Files touched by this commit (3) | Package updated
Log message:
py-test: updated to 3.3.0

Pytest 3.3.0:

Deprecations and Removals
Pytest no longer supports Python 2.6 and 3.3. Those Python versions are EOL for \ 
some time now and incur maintenance and compatibility costs on the pytest core \ 
team, and following up with the rest of the community we decided that they will \ 
no longer be supported starting on this version. Users which still require those \ 
versions should pin pytest to <3.3.
Remove internal _preloadplugins() function. This removal is part of the \ 
pytest_namespace() hook deprecation.
Internally change CallSpec2 to have a list of marks instead of a broken mapping \ 
of keywords. This removes the keywords attribute of the internal CallSpec2 \ 
Remove ParameterSet.deprecated_arg_dict - its not a public api and the lack of \ 
the underscore was a naming error.
Remove the internal multi-typed attribute Node._evalskip and replace it with the \ 
boolean Node._skipped_by_mark.

pytest_fixture_post_finalizer hook can now receive a request argument.
Replace the old introspection code in compat.py that determines the available \ 
arguments of fixtures with inspect.signature on Python 3 and funcsigs.signature \ 
on Python 2. This should respect __signature__ declarations on functions.
Report tests with global pytestmark variable only once.
Now pytest displays the total progress percentage while running tests. The \ 
previous output style can be set by configuring the console_output_style setting \ 
to classic.
Match warns signature to raises by adding match keyword.
Pytest now captures and displays output from the standard logging module. The \ 
user can control the logging level to be captured by specifying options in \ 
pytest.ini, the command line and also during individual tests using markers. \ 
Also, a caplog fixture is available that enables users to test the captured log \ 
during specific tests (similar to capsys for example). For more information, \ 
please see the logging docs. This feature was introduced by merging the popular \ 
pytest-catchlog plugin, thanks to Thomas Hisch. Be advised that during the \ 
merging the backward compatibility interface with the defunct pytest-capturelog \ 
has been dropped.
Add allow_module_level kwarg to pytest.skip(), enabling to skip the whole module.
Allow setting file_or_dir, -c, and -o in PYTEST_ADDOPTS.
Return stdout/stderr capture results as a namedtuple, so out and ``err`` can be \ 
accessed by attribute.
Add capfdbinary, a version of capfd which returns bytes from readouterr().
Add capsysbinary a version of capsys which returns bytes from readouterr().
Implement feature to skip setup.py files when run with --doctest-modules.
   2017-11-15 15:14:49 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-test: updated to 3.2.5

Pytest 3.2.5:

Bug Fixes
Remove py<1.5 restriction from pytest as this can cause version conflicts in \ 
some installations.