Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytester: use monkeypatch with Testdir #5031

Merged
merged 1 commit into from Apr 3, 2019

Conversation

Projects
None yet
2 participants
@blueyed
Copy link
Contributor

blueyed commented Apr 3, 2019

No description provided.

@codecov

This comment has been minimized.

Copy link

codecov bot commented Apr 3, 2019

Codecov Report

Merging #5031 into master will decrease coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5031      +/-   ##
==========================================
- Coverage   96.06%   96.03%   -0.03%     
==========================================
  Files         114      114              
  Lines       25749    25757       +8     
  Branches     2548     2548              
==========================================
+ Hits        24735    24737       +2     
- Misses        704      710       +6     
  Partials      310      310
Impacted Files Coverage Δ
src/_pytest/pytester.py 91.15% <100%> (+0.01%) ⬆️
testing/test_pytester.py 88.29% <100%> (+0.26%) ⬆️
src/_pytest/capture.py 93.65% <0%> (-1.32%) ⬇️

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 49d690d...d915275. Read the comment docs.

@@ -508,7 +512,7 @@ def finalize(self):
self._sys_modules_snapshot.restore()

This comment has been minimized.

Copy link
@nicoddemus

nicoddemus Apr 3, 2019

Member

While at it, would you like to replace those "snapshot" implementations by your monkeypatch instance?

If not, please go ahead and merge it as this is already an improvement

(every time I looked at this code I had the same idea to use monkeypatch for that, but kept forgetting to actually do it 🙃)

This comment has been minimized.

Copy link
@blueyed

blueyed Apr 3, 2019

Author Contributor

Not really now - basically got side-tracked by this already for #5032.

This comment has been minimized.

Copy link
@blueyed

blueyed Apr 3, 2019

Author Contributor

btw: to me it looked just like code that could be improved, assuming that os.environ would get restored, but that's actually not the case.. therefore targetting master.

Show resolved Hide resolved testing/test_pytester.py Outdated

@blueyed blueyed force-pushed the blueyed:pytester-addopts branch from 106427e to 0f68b56 Apr 3, 2019

@blueyed blueyed force-pushed the blueyed:pytester-addopts branch from 0f68b56 to d915275 Apr 3, 2019

@blueyed

This comment has been minimized.

Copy link
Contributor Author

blueyed commented Apr 3, 2019

Azure failure is unrelated.

@blueyed blueyed requested a review from nicoddemus Apr 3, 2019

@nicoddemus nicoddemus merged commit 46df1d5 into pytest-dev:master Apr 3, 2019

3 of 4 checks passed

pytest-CI #20190403.12 failed
Details
codecov/patch 100% of diff hit (target 96.06%)
Details
codecov/project Absolute coverage decreased by -0.02% but relative coverage increased by +3.93% compared to 49d690d
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@nicoddemus

This comment has been minimized.

Copy link
Member

nicoddemus commented Apr 3, 2019

Thanks!

@blueyed blueyed deleted the blueyed:pytester-addopts branch Apr 3, 2019

M157q added a commit to zdict/zdict that referenced this pull request Apr 15, 2019

Update pytest to 4.4.1 (#337)
This PR updates [pytest](https://pypi.org/project/pytest) from **4.4.0** to **4.4.1**.



<details>
  <summary>Changelog</summary>
  
  
   ### 4.4.1
   ```
   =========================

Bug Fixes
---------

- `5031 &lt;https://github.com/pytest-dev/pytest/issues/5031&gt;`_: Environment variables are properly restored when using pytester&#39;s ``testdir`` fixture.


- `5039 &lt;https://github.com/pytest-dev/pytest/issues/5039&gt;`_: Fix regression with ``--pdbcls``, which stopped working with local modules in 4.0.0.


- `5092 &lt;https://github.com/pytest-dev/pytest/issues/5092&gt;`_: Produce a warning when unknown keywords are passed to ``pytest.param(...)``.


- `5098 &lt;https://github.com/pytest-dev/pytest/issues/5098&gt;`_: Invalidate import caches with ``monkeypatch.syspath_prepend``, which is required with namespace packages being used.
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/pytest
  - Changelog: https://pyup.io/changelogs/pytest/
  - Homepage: https://docs.pytest.org/en/latest/
</details>

bors bot added a commit to rehandalal/therapist that referenced this pull request Apr 17, 2019

Merge #67
67: Update pytest to 4.4.1 r=rehandalal a=pyup-bot


This PR updates [pytest](https://pypi.org/project/pytest) from **4.4.0** to **4.4.1**.



<details>
  <summary>Changelog</summary>
  
  
   ### 4.4.1
   ```
   =========================

Bug Fixes
---------

- `5031 &lt;https://github.com/pytest-dev/pytest/issues/5031&gt;`_: Environment variables are properly restored when using pytester&#39;s ``testdir`` fixture.


- `5039 &lt;https://github.com/pytest-dev/pytest/issues/5039&gt;`_: Fix regression with ``--pdbcls``, which stopped working with local modules in 4.0.0.


- `5092 &lt;https://github.com/pytest-dev/pytest/issues/5092&gt;`_: Produce a warning when unknown keywords are passed to ``pytest.param(...)``.


- `5098 &lt;https://github.com/pytest-dev/pytest/issues/5098&gt;`_: Invalidate import caches with ``monkeypatch.syspath_prepend``, which is required with namespace packages being used.
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/pytest
  - Changelog: https://pyup.io/changelogs/pytest/
  - Homepage: https://docs.pytest.org/en/latest/
</details>



Co-authored-by: pyup-bot <github-bot@pyup.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.