Skip to content

Commit 4350f49

Browse files
committed
Merge branch 'issue1629' of https://github.com/davehunt/pytest into features
2 parents f05d65d + 393167b commit 4350f49

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+282
-278
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ Here's a quick checklist in what to include:
44

55
- [ ] Include a detailed description of the bug or suggestion
66
- [ ] `pip list` of the virtual environment you are using
7-
- [ ] py.test and operating system versions
7+
- [ ] pytest and operating system versions
88
- [ ] Minimal example if possible

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ Michael Droettboom
7373
Mike Lundy
7474
Nicolas Delaby
7575
Oleg Pidsadnyi
76+
Oliver Bestwalter
7677
Omar Kohl
7778
Pieter Mulder
7879
Piotr Banaszkiewicz

CHANGELOG.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@
4343
Can also show where fixtures are defined if combined with ``-v``.
4444
Thanks `@hackebrot`_ for the PR.
4545

46+
* Introduce pytest command as recommended entry point. Closes proposal
47+
`#1629`_. Thanks `@obestwalter`_ and `@davehunt`_ for the complete PR
48+
(`#1633`_)
49+
4650
**Changes**
4751

4852
* Fixtures marked with ``@pytest.fixture`` can now use ``yield`` statements exactly like
@@ -100,11 +104,10 @@
100104
.. _@palaviv: https://github.com/palaviv
101105
.. _@omarkohl: https://github.com/omarkohl
102106
.. _@mikofski: https://github.com/mikofski
103-
<<<<<<< HEAD
104107
.. _@sober7: https://github.com/sober7
105-
=======
106108
.. _@olegpidsadnyi: https://github.com/olegpidsadnyi
107-
>>>>>>> upstream/features
109+
.. _@obestwalter: https://github.com/obestwalter
110+
.. _@davehunt: https://github.com/davehunt
108111

109112
.. _#1421: https://github.com/pytest-dev/pytest/issues/1421
110113
.. _#1426: https://github.com/pytest-dev/pytest/issues/1426
@@ -123,6 +126,8 @@
123126
.. _#1544: https://github.com/pytest-dev/pytest/issues/1544
124127
.. _#1616: https://github.com/pytest-dev/pytest/pull/1616
125128
.. _#1628: https://github.com/pytest-dev/pytest/pull/1628
129+
.. _#1629: https://github.com/pytest-dev/pytest/issues/1629
130+
.. _#1633: https://github.com/pytest-dev/pytest/pull/1633
126131

127132

128133
**Bug Fixes**

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ An example of a simple test:
3333
3434
To execute it::
3535

36-
$ py.test
36+
$ pytest
3737
======= test session starts ========
3838
platform linux -- Python 3.4.3, pytest-2.8.5, py-1.4.31, pluggy-0.3.1
3939
collected 1 items
@@ -51,7 +51,7 @@ To execute it::
5151
test_sample.py:5: AssertionError
5252
======= 1 failed in 0.12 seconds ========
5353

54-
Due to ``py.test``'s detailed assertion introspection, only plain ``assert`` statements are used. See `getting-started <http://pytest.org/latest/getting-started.html#our-first-test-run>`_ for more examples.
54+
Due to ``pytest``'s detailed assertion introspection, only plain ``assert`` statements are used. See `getting-started <http://pytest.org/latest/getting-started.html#our-first-test-run>`_ for more examples.
5555

5656

5757
Features

_pytest/capture.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ def _readline_workaround():
463463
464464
Pdb uses readline support where available--when not running from the Python
465465
prompt, the readline module is not imported until running the pdb REPL. If
466-
running py.test with the --pdb option this means the readline module is not
466+
running pytest with the --pdb option this means the readline module is not
467467
imported until after I/O capture has been started.
468468
469469
This is a problem for pyreadline, which is often used to implement readline

_pytest/genscript.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def pytest_namespace():
9999

100100
def freeze_includes():
101101
"""
102-
Returns a list of module names used by py.test that should be
102+
Returns a list of module names used by pytest that should be
103103
included by cx_freeze.
104104
"""
105105
result = list(_iter_all_modules(py))

_pytest/helpconfig.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ def showhelp(config):
9292
tw.line()
9393
tw.line()
9494

95-
tw.line("to see available markers type: py.test --markers")
96-
tw.line("to see available fixtures type: py.test --fixtures")
95+
tw.line("to see available markers type: pytest --markers")
96+
tw.line("to see available fixtures type: pytest --fixtures")
9797
tw.line("(shown according to specified file_or_dir or current dir "
9898
"if not specified)")
9999

_pytest/hookspec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def pytest_addoption(parser):
3434
.. note::
3535
3636
This function should be implemented only in plugins or ``conftest.py``
37-
files situated at the tests root directory due to how py.test
37+
files situated at the tests root directory due to how pytest
3838
:ref:`discovers plugins during startup <pluginorder>`.
3939
4040
:arg parser: To add command line options, call

_pytest/pytester.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,10 @@ def assert_outcomes(self, passed=0, skipped=0, failed=0):
374374

375375

376376
class Testdir:
377-
"""Temporary test directory with tools to test/run py.test itself.
377+
"""Temporary test directory with tools to test/run pytest itself.
378378
379379
This is based on the ``tmpdir`` fixture but provides a number of
380-
methods which aid with testing py.test itself. Unless
380+
methods which aid with testing pytest itself. Unless
381381
:py:meth:`chdir` is used all methods will use :py:attr:`tmpdir` as
382382
current working directory.
383383
@@ -588,7 +588,7 @@ def getpathnode(self, path):
588588
"""Return the collection node of a file.
589589
590590
This is like :py:meth:`getnode` but uses
591-
:py:meth:`parseconfigure` to create the (configured) py.test
591+
:py:meth:`parseconfigure` to create the (configured) pytest
592592
Config instance.
593593
594594
:param path: A :py:class:`py.path.local` instance of the file.
@@ -656,7 +656,7 @@ def inline_genitems(self, *args):
656656
:py:class:`HookRecorder` instance.
657657
658658
This runs the :py:func:`pytest.main` function to run all of
659-
py.test inside the test process itself like
659+
pytest inside the test process itself like
660660
:py:meth:`inline_run`. However the return value is a tuple of
661661
the collection items and a :py:class:`HookRecorder` instance.
662662
@@ -669,7 +669,7 @@ def inline_run(self, *args, **kwargs):
669669
"""Run ``pytest.main()`` in-process, returning a HookRecorder.
670670
671671
This runs the :py:func:`pytest.main` function to run all of
672-
py.test inside the test process itself. This means it can
672+
pytest inside the test process itself. This means it can
673673
return a :py:class:`HookRecorder` instance which gives more
674674
detailed results from then run then can be done by matching
675675
stdout/stderr from :py:meth:`runpytest`.
@@ -755,9 +755,9 @@ def _ensure_basetemp(self, args):
755755
return args
756756

757757
def parseconfig(self, *args):
758-
"""Return a new py.test Config instance from given commandline args.
758+
"""Return a new pytest Config instance from given commandline args.
759759
760-
This invokes the py.test bootstrapping code in _pytest.config
760+
This invokes the pytest bootstrapping code in _pytest.config
761761
to create a new :py:class:`_pytest.core.PluginManager` and
762762
call the pytest_cmdline_parse hook to create new
763763
:py:class:`_pytest.config.Config` instance.
@@ -777,7 +777,7 @@ def parseconfig(self, *args):
777777
return config
778778

779779
def parseconfigure(self, *args):
780-
"""Return a new py.test configured Config instance.
780+
"""Return a new pytest configured Config instance.
781781
782782
This returns a new :py:class:`_pytest.config.Config` instance
783783
like :py:meth:`parseconfig`, but also calls the
@@ -792,7 +792,7 @@ def parseconfigure(self, *args):
792792
def getitem(self, source, funcname="test_func"):
793793
"""Return the test item for a test function.
794794
795-
This writes the source to a python file and runs py.test's
795+
This writes the source to a python file and runs pytest's
796796
collection on the resulting module, returning the test item
797797
for the requested function name.
798798
@@ -812,7 +812,7 @@ def getitem(self, source, funcname="test_func"):
812812
def getitems(self, source):
813813
"""Return all test items collected from the module.
814814
815-
This writes the source to a python file and runs py.test's
815+
This writes the source to a python file and runs pytest's
816816
collection on the resulting module, returning all test items
817817
contained within.
818818
@@ -824,7 +824,7 @@ def getmodulecol(self, source, configargs=(), withinit=False):
824824
"""Return the module collection node for ``source``.
825825
826826
This writes ``source`` to a file using :py:meth:`makepyfile`
827-
and then runs the py.test collection on it, returning the
827+
and then runs the pytest collection on it, returning the
828828
collection node for the test module.
829829
830830
:param source: The source code of the module to collect.
@@ -924,7 +924,7 @@ def _dump_lines(self, lines, fp):
924924

925925
def _getpytestargs(self):
926926
# we cannot use "(sys.executable,script)"
927-
# because on windows the script is e.g. a py.test.exe
927+
# because on windows the script is e.g. a pytest.exe
928928
return (sys.executable, _pytest_fullpath,) # noqa
929929

930930
def runpython(self, script):
@@ -939,7 +939,7 @@ def runpython_c(self, command):
939939
return self.run(sys.executable, "-c", command)
940940

941941
def runpytest_subprocess(self, *args, **kwargs):
942-
"""Run py.test as a subprocess with given arguments.
942+
"""Run pytest as a subprocess with given arguments.
943943
944944
Any plugins added to the :py:attr:`plugins` list will added
945945
using the ``-p`` command line option. Addtionally
@@ -967,9 +967,9 @@ def runpytest_subprocess(self, *args, **kwargs):
967967
return self.run(*args)
968968

969969
def spawn_pytest(self, string, expect_timeout=10.0):
970-
"""Run py.test using pexpect.
970+
"""Run pytest using pexpect.
971971
972-
This makes sure to use the right py.test and sets up the
972+
This makes sure to use the right pytest and sets up the
973973
temporary directory locations.
974974
975975
The pexpect child is returned.

_pytest/python.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2173,7 +2173,7 @@ def formatrepr(self):
21732173
available.append(name)
21742174
msg = "fixture %r not found" % (self.argname,)
21752175
msg += "\n available fixtures: %s" %(", ".join(available),)
2176-
msg += "\n use 'py.test --fixtures [testpath]' for help on them."
2176+
msg += "\n use 'pytest --fixtures [testpath]' for help on them."
21772177

21782178
return FixtureLookupErrorRepr(fspath, lineno, tblines, msg, self.argname)
21792179

0 commit comments

Comments
 (0)