Commit Graph

74 Commits

Author SHA1 Message Date
Ronny Pfannschmidt 083f64100d merge master into features 2016-06-22 14:39:33 +02:00
Dave Hunt ef9dd14963 Introduce pytest command as recommended entry point
Fixes #1629
2016-06-21 16:16:57 +02:00
Daniel Hahler e53e45b55c tests: getexecutable: call `--version` on all Pythons
This should prevent errors from pyenv:

    pyenv: python2.6: command not found

    The `python2.6' command exists in these Python versions:
      2.6.9

While the pyenv wrapper explicitly returns 127, I think it is better to
just check for non-zero?!
2016-06-21 08:36:02 +02:00
Bruno Oliveira a912d3745b Moved py.code code over to py.test
Fix #103
2016-01-25 23:18:04 -02:00
holger krekel 95245b935c - fix a flaky test on py35-xdist by calling
importlib.invalidate_caches()

- bump version to 2.8.1

- regen docs

- amend changelog, authors
2015-09-29 13:10:59 +02:00
Bruno Oliveira e59471766a Rename "warnings" to "pytest-warnings" in terminal output
Fix #970
2015-08-27 19:59:52 -03:00
Bruno Oliveira 033def0a7a Workaround for cmdexec bug on Windows
This bug fails the entire pytest suite when executed with the
--lsof option in Python 2 on Windows.
2015-07-24 19:24:31 -03:00
Bruno Oliveira 0f52856f99 Use a subdirectory in the TEMP directory to speed up tmpdir creation
Fix #105
2015-07-15 20:03:58 -03:00
Bruno Oliveira a7f880fa1f Make "running" output from testdir.run copy/pastable
fix 741

--HG--
branch : issue-741-pytester-output
2015-05-09 10:24:33 -03:00
holger krekel d9a44098ce use new pluggy api (now at 0.3.0) for adding hookcall monitoring
and reraise real keyboard interrupts during inline pytest runs
to allow for better stopping of the pytest tests.

--HG--
branch : plug30
2015-05-07 11:02:55 +02:00
holger krekel bb8141e27c - make sure sub pytest runs use the same basetemp
- depend on pluggy < 0.3

--HG--
branch : pluggy1
2015-05-06 14:58:46 +02:00
holger krekel bddc88f09e adapt to pluggy naming, rename pytest.hookspec_opts to pytest.hookspec,s ame with hookimpl_opts
--HG--
branch : pluggy1
2015-05-06 10:08:08 +02:00
holger krekel 5ee7ee0850 adapt pytest to using pluggy (current master)
--HG--
branch : pluggy1
2015-04-29 16:40:51 +02:00
holger krekel db5649ec6a streamline pytester API majorly:
- integrate conftest into pytester plugin
- introduce runpytest() to either call runpytest_inline (default) or
  runpytest_subprocess (python -m pytest)
- move testdir.inline_runsource1 to pdb tests
- strike some unneccessary methods.
- a new section "writing plugins" and some better pytester docs

--HG--
branch : testrefactor
2015-04-28 11:54:53 +02:00
holger krekel a8afba054a - refine lsof checking
- make runpytest() create an inline testing process instead of
  a subprocess one

--HG--
branch : testrefactor
2015-04-28 11:54:46 +02:00
holger krekel d3e363b97a - make API between runpytest() and inline_run() more similar
- shift a number of tests to become inline_run() tests

--HG--
branch : testrefactor
2015-04-28 11:54:45 +02:00
holger krekel 424e5d1394 make test suite more tolerable against xdist causing warnings itself (which it does
currently)

--HG--
branch : plugtestfix
2015-04-27 15:06:47 +02:00
holger krekel 3a1374e69c simplify plugins bookkeeping further, refine API
--HG--
branch : more_plugin
2015-04-25 20:17:32 +02:00
holger krekel 1e883f5979 simplify tracing mechanics by simply going through an indirection
--HG--
branch : more_plugin
2015-04-25 18:15:39 +02:00
holger krekel 8fde2f98ae merge default
--HG--
branch : plugin_no_pytest
2015-04-23 12:35:15 +02:00
Floris Bruynooghe e450218daa Merge _pytest fixture reintroduction from pytest-2.7 branch
This was accidentally removed while some plugins depend on it.
2015-04-23 00:55:58 +01:00
holger krekel a3aebfaefe accomodate Floris' comments. (The reason was i just reinstanted the old code :)
--HG--
branch : reintroduce_pytest_fixture
2015-04-22 21:04:36 +02:00
holger krekel 9d5182eaad reintroduced _pytest fixture of the pytester plugin which is used
at least by pytest-xdist.

--HG--
branch : reintroduce_pytest_fixture
2015-04-22 17:06:00 +02:00
holger krekel 715a235b45 remove shutdown logic from PluginManager and add a add_cleanup() API
for the already existing cleanup logic of the config object.
This simplifies lifecycle management as we don't keep two
layers of shutdown functions and also simplifies the pluginmanager
interface.

also add some docstrings.

--HG--
branch : plugin_no_pytest
2015-04-22 16:33:20 +02:00
Floris Bruynooghe 240cd1f28d Merge cleaning of sys.modules after pytester.inline_run()
Merged in schettino72/pytest/pytester-inline-run-clean-sys-modules
(pull request #278).
2015-04-21 11:00:32 +01:00
Eduardo Schettino bc0ecd1d06 pytester: add method ``TmpTestdir.delete_loaded_modules()``
, and call it from ``inline_run()`` to allow temporary modules to be reloaded.

--HG--
branch : pytester-inline-run-clean-sys-modules
2015-04-21 10:18:04 +08:00
holger krekel 5c8e5acf9d change test module importing behaviour to append to sys.path
instead of prepending.  This better allows to run test modules
against installated versions of a package even if the package
under test has the same import root.  In this example::

   testing/__init__.py
   testing/test_pkg_under_test.py
   pkg_under_test/

the tests will preferrably run against the installed version
of pkg_under_test whereas before they would always pick
up the local version.

--HG--
branch : prefer_installed
2015-04-17 22:25:35 +02:00
Floris Bruynooghe bf0b70aa66 Some docstrings for the pytester plugin
These aren't quite complete but are a jolly good start anyway.  It
seems better to commit this now then leave it lingering until it
gets lost.
2015-04-11 17:07:37 +01:00
holger krekel d73e689991 fix issue616 - conftest visibility fixes. This is achieved by
refactoring how nodeid's are constructed.  They now are always
relative to the "common rootdir" of a test run which is determined by
finding a common ancestor of all testrun arguments.

--HG--
branch : issue616
2015-02-26 21:56:44 +01:00
holger krekel f5f924d293 - refactor wrapped call support to also accomodate
pytest.mark.hookwrapper
- introduce a CallOutcome class to hold the result/excinfo status of
  calling a function.
- rename add_method_controller to add_method_wrapper
2014-10-08 11:27:14 +02:00
holger krekel 8cfec56a82 simplify internal pytester machinery 2014-10-06 13:37:57 +02:00
holger krekel 63f070317c simplify method to record calls 2014-10-04 15:49:31 +02:00
holger krekel 351931d5ca call scanning of plugins directly, code is shifted from helpconfig.py to core.py 2014-10-01 12:20:11 +02:00
Bruno Oliveira 5603a0cd4b Removing py.std usage from _pytest 2014-07-31 19:13:40 -03:00
Marc Abramowitz f47ae74981 Make makepyfile accept UTF-8 so a few cookie tests in test_assertrewrite.py
don't need to be dedented.

--HG--
branch : makepyfile_utf8
2014-03-28 09:44:18 -07:00
Jurko Gospodnetić 657a395839 fix comment typos 2014-01-18 12:39:16 +01:00
Jurko Gospodnetić 9fb2079458 replace py.test module references with pytest
The only remaining 'py.test' references are:
 * those referring to the 'py.test' executable
 * those in code explicitly testing py.test/pytest module compatibility
 * those in old CHANGES documentation
 * those in documentation generated based on external data
 * those in seemingly unfinished & unmaintained Japanese documentation

Minor stylistic changes and typo corrections made to documentation next to
several applied py.test --> pytest content changes.
2014-01-18 12:31:33 +01:00
holger krekel 1fd1617427 fix pexpect-3.0 compatibility for pytest's own tests.
(fixes issue386)
2013-11-19 10:10:27 +01:00
holger krekel 8ac5af2896 fix flakes issues and make --flakes run part of tox runs 2013-10-12 15:39:22 +02:00
holger krekel 05f6422392 remove unused imports (using "importchecker" project) 2013-10-02 14:32:40 +02:00
holger krekel d226b2faf4 release announcement, bump version numbers, some test adapatations because of random win32 test failures. 2013-10-01 12:37:11 +02:00
holger krekel 4b709037ab some more separation of core pluginmanager from pytest specific functionality.
Idea is to have the PluginManager be re-useable from other projects at some point.
2013-09-30 13:14:14 +02:00
holger krekel d946299b0a shift pytest_configure/unconfigure/addoption/namespace hook calling to config object.
The _pytest.config module itself is no longer a plugin but the actual
config instance is plugin-registered as ``pytestconfig``.
This allows to put most pytest specific logic to _pytest.config instead
of in the core pluginmanager.
2013-09-30 13:14:14 +02:00
holger krekel a930f44e60 introduce pluginmanager.ensure_teardown() which allows 2013-09-28 22:23:00 +02:00
holger krekel ca7c1f5d8e merge pull request #27: correctly handle nose.SkipTest during collection. Thanks
Antonio Cuni, Ronny Pfannschmidt.  I did a few tweaks to the test and the
activation (depending on if unittest is imported at all).
2013-08-16 11:33:58 +02:00
Mathieu Agopian 7fc0d45a4c refs #322: setUpClass and tearDownClass as autouse fixture and finalizer 2013-08-01 23:48:40 +02:00
holger krekel 06ab38a2fc strip old comment and hack 2013-02-03 20:47:39 +01:00
holger krekel 0852e84d9f skip pexpect using tests on freebsd 2012-10-19 15:59:29 +02:00
holger krekel 22dc47d9f9 refine internal test support for unicode-related bits (used by a test in pytest-pep8) 2012-09-20 10:57:23 +02:00
Ronny Pfannschmidt bfaf8e50b6 fix issue 182: testdir.inprocess_run now considers passed plugins 2012-09-03 10:12:30 +02:00