Commit Graph

101 Commits

Author SHA1 Message Date
turturica 8cf0e46bbf test_package_ordering: Collect *.py, but keep a mix of case for filenames. The test doesn't make sense for Windows, because of its case-insensitivity. 2018-08-24 16:23:50 -07:00
Bruno Oliveira f0226e9329 Fix test_package_ordering on Windows 2018-08-24 20:15:33 -03:00
turturica 3396225f74 Merge branch 'master' of github.com:pytest-dev/pytest into fix-3854 2018-08-24 11:47:24 -07:00
Anthony Sottile 85482d575e Replace Source with dedent where possible 2018-08-23 09:06:17 -07:00
turturica 4d3c1ab4f0 Fixes #3854 2018-08-22 21:42:59 -07:00
turturica e92893ed24 Add test for packages mixed with modules. 2018-08-10 17:29:30 -07:00
Bruno Oliveira dcafb8c48c Add example for package recursion bug 2018-08-03 15:40:33 -03:00
Bruno Oliveira 3c19370cec Merge remote-tracking branch 'upstream/features' into jonozzz/features 2018-07-05 18:15:17 -03:00
Serhii Mozghovyi 1dc5e97ac2 Make test parametrization override indirect fixtures 2018-06-28 14:32:29 +03:00
Anthony Sottile cbaa7dd56a Upgrade pre-commit hooks except pyupgrade 2018-06-26 06:35:27 -07:00
Ronny Pfannschmidt 3e08c4ee64 sort out flake8 issues and unicode name usage 2018-05-23 18:12:04 +02:00
Ronny Pfannschmidt 703e4b11ba run black 2018-05-23 16:48:46 +02:00
turturica c02e8d8b0d Fix test collection when tests are passed as IDs at the command line. Note this is still broken due to #3358. 2018-04-16 11:44:05 -07:00
Bruno Oliveira aff463a3c4 Merge remote-tracking branch 'upstream/master' into features 2018-01-27 12:28:43 -02:00
Bruno Oliveira af37778b0d All classes now subclass object for better py3 compatibility
Fix #2147
2018-01-24 18:23:42 -02:00
Anthony Sottile bd1d17e8de Replace py.std with stdlib imports 2018-01-09 12:44:10 -08:00
Ronny Pfannschmidt afc607cfd8 move node base classes from main to nodes 2017-12-18 11:08:20 +01:00
Bruno Oliveira 983a09a2d4 Merge remote-tracking branch 'upstream/master' into merge-master-into-features 2017-11-10 18:33:02 -02:00
Bruno Oliveira 03829fde8a Fix linting E741: ambiguous variable name 2017-11-04 13:59:10 -02:00
hugovk ef732fc51d Remove code for unsupported Python versions 2017-10-10 08:54:56 +03:00
Bruno Oliveira afe7966683 Fix call to outcome.get_result now that outcome.result is deprecated 2017-09-18 21:36:54 -03:00
Bruno Oliveira 9273e11f21 Merge branch 'master' into features 2017-09-07 13:59:10 -03:00
Bruno Oliveira 3dc0da9339 Remove __multicall__ warning and usages in testing
pluggy>=0.5 already warns about those
2017-09-01 18:53:06 -03:00
Bruno Oliveira a993add783 Allow tests declared as @staticmethod to use fixtures
Fix #2699
2017-08-17 20:44:19 -03:00
Bruno Oliveira 0726d9a09f Turn warnings into errors in pytest's own test suite
Fix #2588
2017-07-22 21:44:18 -03:00
Bruno Oliveira 7b1870a94e Fix flake8 in features branch 2017-07-17 21:16:14 -03:00
Bruno Oliveira 4fd92ef9ba Merge branch 'fix-flake8-issues' into features 2017-07-17 21:05:39 -03:00
Andras Tim 7248b759e8 Fixed E303 flake8 errors
too many blank lines (3)
2017-07-17 01:44:23 +02:00
Andras Tim b840622819 Fixed E302 flake8 errors
expected 2 blank lines, found 0
2017-07-17 01:44:23 +02:00
Andras Tim 8f3eb6dfc7 Fixed E261 flake8 errors
at least two spaces before inline comment
2017-07-17 01:44:22 +02:00
Andras Tim 617e510b6e Fixed E231 flake8 errors
missing whitespace after ‘,’, ‘;’, or ‘:’
2017-07-17 01:44:22 +02:00
Andras Tim cf97159009 Fixed E128 flake8 errors
continuation line under-indented for visual indent
2017-07-17 01:28:16 +02:00
Nathaniel Waisbrot 9b9fede5be
allow staticmethods to be detected as test functions
Allow a class method decorated `@staticmethod` to be collected as a test
function (if it meets the usual criteria).

This feature will not work in Python 2.6 -- static methods will still be
ignored there.
2017-06-29 07:44:36 -04:00
Bruno Oliveira f3b359f5b8 Merge remote-tracking branch 'upstream/master' into merge-master-into-features
# Conflicts:
#	_pytest/capture.py
#	_pytest/compat.py
#	_pytest/python.py
#	testing/python/collect.py
#	testing/test_mark.py
2017-05-03 19:04:53 -03:00
Kodi Arfer dcefb287fc Try not to assume a module's file extension is .py 2017-04-19 12:26:56 -07:00
Bruno Oliveira 58ac4faf0c Fix exception formatting while importing test modules
Fix #2336
2017-03-29 14:43:13 -03:00
Bruno Oliveira 9f85584656 Merge remote-tracking branch 'upstream/features' into integrate-pytest-warnings 2017-03-20 19:59:05 -03:00
Bruno Oliveira e5021dc9dc Replace py.builtin.print_() calls by builtin print() function 2017-03-16 22:46:51 -03:00
Bruno Oliveira 78194093af Improve warning representation in terminal plugin and fix tests 2017-03-16 21:57:32 -03:00
Bruno Oliveira 1e0cf5ce4d Merge remote-tracking branch 'upstream/master' into merge-master-into-features
# Conflicts:
#	AUTHORS
#	CHANGELOG.rst
#	_pytest/pytester.py
2017-03-10 15:54:05 -03:00
Michal Wajszczuk fb0b90646e New-style classes implemented for python 2.7 - #2147 2017-02-16 20:28:17 +01:00
Ran Benita 3a0a0c2df9 Ignore errors raised from descriptors when collecting fixtures
Descriptors (e.g. properties) such as in the added test case are
triggered during collection, executing arbitrary code which can raise.
Previously, such exceptions were propagated and failed the collection.
Now these exceptions are caught and the corresponding attributes are
silently ignored.

A better solution would be to completely skip access to all custom
descriptors, such that the offending code doesn't even trigger. However
I think this requires manually going through the instance and all of its
MRO for each and every attribute checking if it might be a proper
fixture before accessing it. So I took the easy route here.

In other words, putting something like this in your test class is still
a bad idea...:

    @property
    def innocent(self):
        os.system('rm -rf /')

Fixes #2234.
2017-02-07 14:27:34 +02:00
Bruno Oliveira 1eb5a690d4 Fix flake8 E305 and E306 errors
These errors started to appear with flake8-3.1.1, while they don't appear with
version 3.1.0 (weird).
2016-11-20 18:59:15 -02:00
Bruno Oliveira a1d446b8e8 Display traceback from Import errors using pytest's short representation
Also omit pytest's own modules and internal libraries (py and pluggy) in low verbosity

Fix #1976
2016-10-03 21:46:44 -03:00
Bruno Oliveira 7d66e4eae1 Display full traceback from Import errors when collecting test modules
Fix #1976
2016-10-03 20:47:44 -03:00
Bruno Oliveira 1a79137d04 Add originalname attribute to Function
Related to #1790
2016-08-03 22:56:12 -03:00
Bruno Oliveira c2864aba3d Merge branch 'master' into merge-master
# Conflicts:
#	AUTHORS
#	CHANGELOG.rst
#	_pytest/monkeypatch.py
#	_pytest/python.py
2016-07-25 19:06:29 -03:00
Roberto Polli ab6aef1d1f feature: default behavior now is to ignore duplicate paths specified from the command line. Use --keep-duplicates to retain duplicate paths. 2016-07-25 12:41:58 +02:00
Dmitry Dygalo f7ad173fee Fixed collection of classes with custom ``__new__`` method 2016-07-25 11:33:37 +02:00
Bruno Oliveira 458ecae1df Replace all usages of "pytest_funcarg__" for @pytest.fixture 2016-07-11 22:21:52 -03:00