- New
pytest.mark.skip
mark, which unconditional skips marked tests. Thanks `@MichaelAquilina`_ for the complete PR (`#1040`_). - Fix `#680`_: the -s and -c options should now work under xdist;
Config.fromdictargs
now represents its input much more faithfully. Thanks to `@bukzor`_ for the complete PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# python 2 | |
def foo(**kwargs): | |
x = kwargs.pop('x', 10) | |
y = kwargs.pop('y', 'no value') | |
if kwargs: | |
raise TypeError('unknown keyword arguments: %s' % kwargs.keys()) | |
print x, y | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Code typically replaced by _warnings | |
def warn(message, category=None, stacklevel=1): | |
"""Issue a warning, or maybe ignore it or raise an exception.""" | |
# Check if message is already a Warning object | |
if isinstance(message, Warning): | |
category = message.__class__ | |
# Check category argument | |
if category is None: | |
category = UserWarning | |
if not (isinstance(category, type) and issubclass(category, Warning)): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import unicode_literals | |
from __future__ import print_function | |
import json | |
import subprocess | |
libs = json.loads(subprocess.check_output('conda list -e --json', shell=True)) | |
lines = [] | |
for name in libs: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
from pyftpdlib.authorizers import DummyAuthorizer | |
from pyftpdlib.handlers import FTPHandler | |
from pyftpdlib.servers import FTPServer | |
import pytest | |
@pytest.yield_fixture | |
def ftp_server(tmpdir, request): | |
authorizer = DummyAuthorizer() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"%PYTHON%" setup.py install | |
if errorlevel 1 exit 1 | |
:: Add more build steps here, if they are necessary. | |
:: See | |
:: http://docs.continuum.io/conda/build.html | |
:: for a list of environment variables that are set during the build process. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import absolute_import, division, print_function, unicode_literals | |
from functools import partial | |
class Hooks: | |
def pytest_about_to_timeout(self, config): | |
pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=========================== pytest-warning summary ============================ | |
WW0 in testing\acceptance_test.py:629 the following warning was recorded: | |
..\..\..\..\..\..\..\..\..\pytest\.tox\py35\lib\site-packages\_pytest\vendored_packages\pluggy.py:250: PendingDeprecationWarning: generator 'pytest_pycollect_makeitem' raised StopIteration | |
wrap_controller.send(call_outcome) | |
WW0 in testing\deprecated_test.py:62 the following warning was recorded: | |
.tox\py35\lib\site-packages\_pytest\recwarn.py:65: DeprecationWarning: use of getfuncargvalue is deprecated, use getfixturevalue | |
old_warn(message, category, *args, **kwargs) | |
WW0 in testing\test_collection.py:350 the following warning was recorded: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Creates a dummy tree with test files, with or without conftest.py files. | |
Usage: | |
generate_tests_tree.py 4 6 10 0 | |
Generates a tree 4 levels deep, 6 folders per level and 10 test files each, without any conftest.py files. Each | |
test file contains 10 dummy tests. | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ unzip -l library.zip | |
Archive: library.zip | |
Length Date Time Name | |
--------- ---------- ----- ---- | |
0 2016-11-30 08:21 funcsigs/ | |
0 2016-11-30 08:21 funcsigs-1.0.2.dist-info/ | |
13297 2016-11-30 08:21 funcsigs-1.0.2.dist-info/DESCRIPTION.rst | |
4 2016-11-30 08:21 funcsigs-1.0.2.dist-info/INSTALLER | |
14420 2016-11-30 08:21 funcsigs-1.0.2.dist-info/METADATA | |
1294 2016-11-30 08:21 funcsigs-1.0.2.dist-info/metadata.json |