./devel/py-test, Python testing tool

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


Branch: CURRENT, Version: 3.2.2, Package name: py27-test-3.2.2, 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]

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

Master sites:

SHA1: cea4f713dea6fe57aa224a19507bb755e4892d33
RMD160: 21ce162286979f09371bb60d690c005552200b01
Filesize: 767.965 KB

Version history: (Expand)


CVS history: (Expand)


   2017-09-08 13:05:52 by Adam Ciarcinski | Files touched by this commit (2)
Log message:
Pytest 3.2.2:

Bug Fixes
* Calling the deprecated request.getfuncargvalue() now shows the source of the call.
* Allow tests declared as @staticmethod to use fixtures.
* Fixed edge-case during collection: attributes which raised pytest.fail when \ 
accessed would abort the entire collection.
* Fix ReprFuncArgs with mixed unicode and UTF-8 args.

Improved Documentation
* In examples on working with custom markers, add examples demonstrating the \ 
usage of pytest.mark.MARKER_NAME.with_args in comparison with \ 
pytest.mark.MARKER_NAME.__call__
* In one of the simple examples, use pytest_collection_modifyitems() to skip \ 
tests based on a command-line option, allowing its sharing while preventing a \ 
user error when acessing pytest.config before the argument parsing.

Trivial/Internal Changes
* Fixed minor error in ‘Good Practices/Manual Integration’ code snippet.
* Fixed typo in goodpractices.rst.
* Improve user guidance regarding --resultlog deprecation.
   2017-08-13 11:48:54 by Adam Ciarcinski | Files touched by this commit (2)
Log message:
Pytest 3.2.1
Bug Fixes:
* Fixed small terminal glitch when collecting a single test item.
* Correctly consider / as the file separator to automatically mark plugin files \ 
for rewrite on Windows.
* Properly escape test names when setting PYTEST_CURRENT_TEST environment variable.
* Fix error on Windows and Python 3.6+ when sys.stdout has been replaced with a \ 
stream-like object which does not implement the full io module buffer protocol. \ 
In particular this affects pytest-xdist users on the aforementioned platform.

Improved Documentation
* Explicitly document which pytest features work with unittest.
   2017-08-03 09:44:11 by Adam Ciarcinski | Files touched by this commit (3)
Log message:
Pytest 3.2.0:
Deprecations and Removals
pytest.approx no longer supports >, >=, < and <= operators to avoid \ 
surprising/inconsistent behavior. See the docs for more information.
All old-style specific behavior in current classes in the pytest’s API is \ 
considered deprecated at this point and will be removed in a future release. \ 
This affects Python 2 users only and in rare situations.
A deprecation warning is now raised when using marks for parameters in \ 
pytest.mark.parametrize. Use pytest.param to apply marks to parameters instead.

Features
Add support for numpy arrays (and dicts) to approx.
Now test function objects have a pytestmark attribute containing a list of marks \ 
applied directly to the test function, as opposed to marks inherited from parent \ 
classes or modules.
Collection ignores local virtualenvs by default; –collect-in-virtualenv \ 
overrides this behavior.
Allow class methods decorated as @staticmethod to be candidates for collection \ 
as a test function. (Only for Python 2.7 and above. Python 2.6 will still ignore \ 
static methods.)
Introduce mark.with_args in order to allow passing functions/classes as sole \ 
argument to marks.
New cache_dir ini option: sets the directory where the contents of the cache \ 
plugin are stored. Directory may be relative or absolute path: if relative path, \ 
then directory is created relative to rootdir, otherwise it is used as is. \ 
Additionally path may contain environment variables which are expanded during \ 
runtime.
Introduce the PYTEST_CURRENT_TEST environment variable that is set with the \ 
nodeid and stage (setup, call and teardown) of the test being currently \ 
executed. See the documentation for more info.
Introduced @pytest.mark.filterwarnings mark which allows overwriting the \ 
warnings filter on a per test, class or module level. See the docs for more \ 
information.
--last-failed now remembers forever when a test has failed and only forgets it \ 
if it passes again. This makes it easy to fix a test suite by selectively \ 
running files and fixing tests incrementally.
New pytest_report_collectionfinish hook which allows plugins to add messages to \ 
the terminal reporting after collection has been finished successfully.
Added support for PEP-415’s Exception.__suppress_context__. Now if a raise \ 
exception from None is caught by pytest, pytest will no longer chain the context \ 
in the test report. The behavior now matches Python’s traceback behavior.
Exceptions raised by pytest.fail, pytest.skip and pytest.xfail now subclass \ 
BaseException, making them harder to be caught unintentionally by normal code.

Bug Fixes
Set stdin to a closed PIPE in pytester.py.Testdir.popen() for avoid unwanted \ 
interactive pdb
Add missing encoding attribute to sys.std* streams when using capsys capture mode.
Fix terminal color changing to black on Windows if colorama is imported in a \ 
conftest.py file.
Fix line number when reporting summary of skipped tests.
capture: ensure that EncodedFile.name is a string.
The options --fixtures and --fixtures-per-test will now keep indentation within \ 
docstrings.
doctests line numbers are now reported correctly, fixing pytest-sugar.
Fix non-determinism in order of fixture collection. Adds new dependency \ 
(ordereddict) for Python 2.6.
   2017-07-05 17:33:29 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
Pytest 3.1.3:
Bug Fixes
* Fix decode error in Python 2 for doctests in docstrings.
* Exceptions raised during teardown by finalizers are now suppressed until all \ 
finalizers are called, with the initial exception reraised.
* Fix incorrect “collected items” report when specifying tests on the \ 
command- line.
deprecated_call in context-manager form now captures deprecation warnings even \ 
if the same warning has already been raised. Also, deprecated_call will always \ 
produce the same error message (previously it would produce different messages \ 
in context-manager vs. function-call mode).
* Fix issue where paths collected by pytest could have triple leading / characters.
* Fix internal error when trying to detect the start of a recursive traceback.

Improved Documentation
* Explicitly state for which hooks the calls stop after the first non-None result.

Trivial/Internal Changes
* Create invoke tasks for updating the vendored packages.
* Update copyright dates in LICENSE, README.rst and in the documentation.
   2017-06-10 21:22:12 by Adam Ciarcinski | Files touched by this commit (2)
Log message:
Pytest 3.1.2 (2017-06-08)
Bug Fixes
* Required options added via pytest_addoption will no longer prevent using \ 
–help without passing them.
* Respect python_files in assertion rewriting.
* Fix recursion error detection when frames in the traceback contain objects \ 
that can’t be compared (like numpy arrays).
* UnicodeWarning is issued from the internal pytest warnings plugin only when \ 
the message contains non-ascii unicode (Python 2 only).
* Added a workaround for Python 3.6 WindowsConsoleIO breaking due to \ 
Pytests’s FDCapture. Other code using console handles might still be \ 
affected by the very same issue and might require further workarounds/fixes, \ 
i.e. colorama.
   2017-06-01 09:14:32 by Adam Ciarcinski | Files touched by this commit (2)
Log message:
Pytest 3.1.1 (2017-05-30)
Bug Fixes
* pytest warning capture no longer overrides existing warning filters. The \ 
previous behaviour would override all filters and caused regressions in test \ 
suites which configure warning filters to match their needs. Note that as a \ 
side-effect of this is that DeprecationWarning and PendingDeprecationWarning are \ 
no longer shown by default.
* Fix issue with non-ascii contents in doctest text files.
* Fix encoding errors for unicode warnings in Python 2.
* pytest.deprecated_call now captures PendingDeprecationWarning in context \ 
manager form.

Improved Documentation
* Addition of towncrier for changelog management.
   2017-05-28 12:44:48 by Thomas Klausner | Files touched by this commit (1)
Log message:
Add build dependency on py-setuptools_scm.
   2017-05-23 10:30:11 by Adam Ciarcinski | Files touched by this commit (3)
Log message:
Chages 3.1.0:

New Features

* The ``pytest-warnings`` plugin has been integrated into the core, so now \ 
``pytest`` automatica
lly
  captures and displays warnings at the end of the test session.

* Added ``junit_suite_name`` ini option to specify root `<testsuite>` name \ 
for JUnit XML reports

* Added an ini option ``doctest_encoding`` to specify which encoding to use for \ 
doctest files.

* ``pytest.warns`` now checks for subclass relationship rather than
  class equality.

* ``pytest.raises`` now asserts that the error message matches a text or regex
  with the ``match`` keyword argument.

* ``pytest.param`` can be used to declare test parameter sets with marks and \ 
test ids.