Skip to content

Commit

Permalink
Merge bba09f8 into 0c63762
Browse files Browse the repository at this point in the history
  • Loading branch information
RedBeardCode committed Jun 25, 2016
2 parents 0c63762 + bba09f8 commit c089e23
Show file tree
Hide file tree
Showing 19 changed files with 25 additions and 397 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG.rst
Expand Up @@ -38,7 +38,18 @@

*

*
**Incompatible changes**

* Removing the following deprecated commandline options

* genscript
* no-assert
* nomagic
* report

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



.. _#1580: https://github.com/pytest-dev/pytest/pull/1580
.. _#1605: https://github.com/pytest-dev/pytest/issues/1605
Expand All @@ -47,6 +58,7 @@
.. _#1553: https://github.com/pytest-dev/pytest/issues/1553
.. _#1626: https://github.com/pytest-dev/pytest/pull/1626
.. _#1503: https://github.com/pytest-dev/pytest/issues/1503
.. _#1664: https://github.com/pytest-dev/pytest/pull/1664

.. _@graingert: https://github.com/graingert
.. _@taschini: https://github.com/taschini
Expand Down
11 changes: 0 additions & 11 deletions _pytest/assertion/__init__.py
Expand Up @@ -23,15 +23,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 @@ -44,8 +35,6 @@ def __init__(self, config, mode):

def pytest_configure(config):
mode = config.getvalue("assertmode")
if config.getvalue("noassert") or config.getvalue("nomagic"):
mode = "plain"
if mode == "rewrite":
try:
import ast # noqa
Expand Down
2 changes: 1 addition & 1 deletion _pytest/config.py
Expand Up @@ -64,7 +64,7 @@ class UsageError(Exception):

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

builtin_plugins = set(default_plugins)
Expand Down
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
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
Expand Up @@ -287,3 +287,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.
7 changes: 1 addition & 6 deletions doc/en/getting-started.rst
Expand Up @@ -193,7 +193,7 @@ Where to go next
Here are a few suggestions where to go next:

* :ref:`cmdline` for command line invocation examples
* :ref:`good practices <goodpractices>` for virtualenv, test layout, genscript support
* :ref:`good practices <goodpractices>` for virtualenv, test layout
* :ref:`fixtures` for providing a functional baseline to your tests
* :ref:`apiref` for documentation and examples on using ``pytest``
* :ref:`plugins` managing and writing plugins
Expand Down Expand Up @@ -227,11 +227,6 @@ py.test not found on Windows despite installation?

.. _`Jython does not create command line launchers`: http://bugs.jython.org/issue1491

- **Jython2.5.1 on Windows XP**: `Jython does not create command line launchers`_
so ``py.test`` will not work correctly. You may install py.test on
CPython and type ``py.test --genscript=mytest`` and then use
``jython mytest`` to run your tests with Jython using ``pytest``.

:ref:`examples` for more complex examples

.. include:: links.inc
33 changes: 0 additions & 33 deletions doc/en/goodpractices.rst
Expand Up @@ -243,38 +243,5 @@ using the ``--pytest-args`` or ``-a`` command-line option. For example::
is equivalent to running ``py.test --durations=5``.


.. _standalone:
.. _`genscript method`:

(deprecated) Create a pytest standalone script
-----------------------------------------------

.. deprecated:: 2.8

.. note::

``genscript`` has been deprecated because:

* It cannot support plugins, rendering its usefulness extremely limited;
* Tooling has become much better since ``genscript`` was introduced;
* It is possible to build a zipped ``pytest`` application without the
shortcomings above.

There's no planned version in which this command will be removed
at the moment of this writing, but its use is discouraged for new
applications.

If you are a maintainer or application developer and want people
who don't deal with python much to easily run tests you may generate
a standalone ``pytest`` script::

py.test --genscript=runtests.py

This generates a ``runtests.py`` script which is a fully functional basic
``pytest`` script, running unchanged under Python2 and Python3.
You can tell people to download the script and then e.g. run it like this::

python runtests.py


.. include:: links.inc
1 change: 0 additions & 1 deletion doc/en/plugins.rst
Expand Up @@ -138,7 +138,6 @@ in the `pytest repository <https://github.com/pytest-dev/pytest>`_.
_pytest.capture
_pytest.config
_pytest.doctest
_pytest.genscript
_pytest.helpconfig
_pytest.junitxml
_pytest.mark
Expand Down

0 comments on commit c089e23

Please sign in to comment.