Skip to content

Conversation

@blueyed
Copy link
Contributor

@blueyed blueyed commented Mar 26, 2019

No description provided.

blueyed and others added 18 commits March 15, 2019 02:47
Includes an example of multiple expressions
…-offset

Fix line offsets with `ScopeMismatch` errors
ci: rename "trial" tox factor to "twisted"
pytest 4.3.1 throws an error if `pytestmark` is set to a tuple of marks; it appears to insist on a list.



With `pytestmark = [pytest.mark.api, pytest.mark.good]`:

```
============================== test session starts ==============================
platform win32 -- Python 3.6.3, pytest-4.3.1, py-1.8.0, pluggy-0.9.0
rootdir: C:\Temp\git\sphobjinv, inifile: tox.ini
plugins: timeout-1.3.3
collected 48 items / 41 deselected / 7 selected

tests\test_api_good.py .......                                             [100%]

==================== 7 passed, 41 deselected in 0.15 seconds ====================
```


With `pytestmark = (pytest.mark.api, pytest.mark.good)`:
```
==================================== ERRORS =====================================
____________________ ERROR collecting tests/test_api_good.py ____________________
env\lib\site-packages\_pytest\runner.py:226: in from_call
    result = func()
env\lib\site-packages\_pytest\runner.py:289: in <lambda>
    call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
env\lib\site-packages\_pytest\python.py:435: in collect
    self._inject_setup_module_fixture()
env\lib\site-packages\_pytest\python.py:447: in _inject_setup_module_fixture
    setup_module = _get_non_fixture_func(self.obj, "setUpModule")
env\lib\site-packages\_pytest\python.py:255: in obj
    self.own_markers.extend(get_unpacked_marks(self.obj))
env\lib\site-packages\_pytest\mark\structures.py:244: in get_unpacked_marks
    return normalize_mark_list(mark_list)
env\lib\site-packages\_pytest\mark\structures.py:259: in normalize_mark_list
    raise TypeError("got {!r} instead of Mark".format(mark))
E   TypeError: got (MarkDecorator(mark=Mark(name='api', args=(), kwargs={})), MarkDecorator(mark=Mark(name='good', args=(), kwargs={}))) instead of Mark
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!
==================== 19 deselected, 1 error in 0.27 seconds =====================
```
Fix pytestmark syntax in reference.rst
This avoids including generated test files with "src" in their path.
.coveragerc: use "src" only from current dir
test_collect_capturing: cover captured stderr
Fix pytest's own tests with `-W error::ResourceWarning`
…cess

test_as_errors: use subprocess with `-W`
@codecov
Copy link

codecov bot commented Mar 26, 2019

Codecov Report

Merging #5000 into features will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##           features    #5000      +/-   ##
============================================
+ Coverage     95.96%   95.97%   +<.01%     
============================================
  Files           113      113              
  Lines         25359    25359              
  Branches       2501     2501              
============================================
+ Hits          24337    24339       +2     
+ Misses          715      714       -1     
+ Partials        307      306       -1
Impacted Files Coverage Δ
testing/test_session.py 100% <ø> (ø) ⬆️
src/_pytest/mark/__init__.py 97.56% <ø> (ø) ⬆️
testing/test_capture.py 99.24% <100%> (ø) ⬆️
src/_pytest/fixtures.py 97.93% <100%> (ø) ⬆️
testing/python/fixtures.py 99.08% <100%> (ø) ⬆️
testing/test_warnings.py 98.9% <100%> (ø) ⬆️
src/_pytest/capture.py 94.84% <0%> (+0.44%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4148663...e1ae469. Read the comment docs.

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@nicoddemus nicoddemus merged commit ee96214 into pytest-dev:features Mar 26, 2019
@blueyed blueyed deleted the merge-master-into-features branch March 26, 2019 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants