Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove cmd options #1677

Merged
merged 3 commits into from
Jun 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,22 @@

*

**Incompatible changes**

* Removing the following deprecated commandline options

* ``--genscript``
* ``--no-assert``
* ``--nomagic``
* ``--report``

Thanks to `@RedBeardCode`_ for the PR(`#1664`_)


.. _#607: https://github.com/pytest-dev/pytest/issues/607
.. _#1519: https://github.com/pytest-dev/pytest/pull/1519
.. _#1664: https://github.com/pytest-dev/pytest/pull/1664


2.10.0.dev1
===========
Expand Down Expand Up @@ -146,7 +160,6 @@
* Add proposal to docs for a new feature that enables users to combine multiple
fixtures into one. Thanks to `@hpk42`_ and `@hackebrot`_.

*

.. _#1580: https://github.com/pytest-dev/pytest/pull/1580
.. _#1605: https://github.com/pytest-dev/pytest/issues/1605
Expand Down
13 changes: 0 additions & 13 deletions _pytest/assertion/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@ def pytest_addoption(parser):
'rewrite' (the default) rewrites assert
statements in test modules on import to
provide assert expression information. """)
group.addoption('--no-assert',
action="store_true",
default=False,
dest="noassert",
help="DEPRECATED equivalent to --assert=plain")
group.addoption('--nomagic', '--no-magic',
action="store_true",
default=False,
help="DEPRECATED equivalent to --assert=plain")


class AssertionState:
Expand All @@ -48,10 +39,6 @@ def __init__(self, config, mode):
def pytest_load_initial_conftests(early_config, parser, args):
ns, ns_unknown_args = parser.parse_known_and_unknown_args(args)
mode = ns.assertmode
no_assert = ns.noassert
no_magic = ns.nomagic
if no_assert or no_magic:
mode = "plain"
if mode == "rewrite":
try:
import ast # noqa
Expand Down
5 changes: 3 additions & 2 deletions _pytest/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ class UsageError(Exception):

default_plugins = (
"mark main terminal runner python pdb unittest capture skipping "
"tmpdir monkeypatch recwarn pastebin helpconfig nose assertion genscript "
"junitxml resultlog doctest cacheprovider setuponly setupplan").split()
"tmpdir monkeypatch recwarn pastebin helpconfig nose assertion "
"junitxml resultlog doctest cacheprovider freeze_support "
"setuponly setupplan").split()

builtin_plugins = set(default_plugins)
builtin_plugins.add("pytester")
Expand Down
45 changes: 45 additions & 0 deletions _pytest/freeze_support.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
"""
Provides a function to report all internal modules for using freezing tools
pytest
"""

def pytest_namespace():
return {'freeze_includes': freeze_includes}


def freeze_includes():
"""
Returns a list of module names used by py.test that should be
included by cx_freeze.
"""
import py
import _pytest
result = list(_iter_all_modules(py))
result += list(_iter_all_modules(_pytest))
return result


def _iter_all_modules(package, prefix=''):
"""
Iterates over the names of all modules that can be found in the given
package, recursively.
Example:
_iter_all_modules(_pytest) ->
['_pytest.assertion.newinterpret',
'_pytest.capture',
'_pytest.core',
...
]
"""
import os
import pkgutil
if type(package) is not str:
path, prefix = package.__path__[0], package.__name__ + '.'
else:
path = package
for _, name, is_package in pkgutil.iter_modules([path]):
if is_package:
for m in _iter_all_modules(os.path.join(path, name), prefix=name + '.'):
yield prefix + m
else:
yield prefix + name
132 changes: 0 additions & 132 deletions _pytest/genscript.py

This file was deleted.

89 changes: 0 additions & 89 deletions _pytest/standalonetemplate.py

This file was deleted.

14 changes: 0 additions & 14 deletions _pytest/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ def pytest_addoption(parser):
group._addoption('-l', '--showlocals',
action="store_true", dest="showlocals", default=False,
help="show locals in tracebacks (disabled by default).")
group._addoption('--report',
action="store", dest="report", default=None, metavar="opts",
help="(deprecated, use -r)")
group._addoption('--tb', metavar="style",
action="store", dest="tbstyle", default='auto',
choices=['auto', 'long', 'short', 'no', 'line', 'native'],
Expand All @@ -54,17 +51,6 @@ def mywriter(tags, args):

def getreportopt(config):
reportopts = ""
optvalue = config.option.report
if optvalue:
py.builtin.print_("DEPRECATED: use -r instead of --report option.",
file=sys.stderr)
if optvalue:
for setting in optvalue.split(","):
setting = setting.strip()
if setting == "skipped":
reportopts += "s"
elif setting == "xfailed":
reportopts += "x"
reportchars = config.option.reportchars
if reportchars:
for char in reportchars:
Expand Down
3 changes: 3 additions & 0 deletions doc/en/assert.rst
Original file line number Diff line number Diff line change
Expand Up @@ -314,3 +314,6 @@ For further information, Benjamin Peterson wrote up `Behind the scenes of pytest
.. versionchanged:: 2.1
Introduce the ``--assert`` option. Deprecate ``--no-assert`` and
``--nomagic``.

.. versionchanged:: 3.0
Removes the ``--no-assert`` and``--nomagic`` options.
Loading