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

Fix compatibility with pytest 3.8.0 #312

Merged
merged 2 commits into from Sep 14, 2018

Conversation

nicoddemus
Copy link
Contributor

As discussed in pytest-dev/pytest#3973, pytest 3.8.0
introduced some code that ends up checking the cwd by accident. One of
the tests in your test suites changes the cwd to a temporary directory, and
this blows up some tests after it.

This change uses the monkeypatch fixture to safe cwd-switching, by
restoring it to the original value at the end of the test.

As discussed in pytest-dev/pytest#3973, pytest 3.8.0
introduced some code that ends up checking the `cwd` by accident. One of
the tests in your test suites changes the `cwd` to a temporary directory, and
this blows up some tests after it.

This change uses the `monkeypatch` fixture to safe cwd-switching, by
restoring it to the original value at the end of the test.
Copy link

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Choose a reason for hiding this comment

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

for full sanity its required to do the monkeypatch.undo before the rmtree, not in the teardown

@nicoddemus
Copy link
Contributor Author

Fair enough, thanks! Done

@Peque Peque self-requested a review September 14, 2018 07:21
@Peque Peque added this to the 0.7.0 milestone Sep 14, 2018
@Peque Peque self-assigned this Sep 14, 2018
@Peque Peque merged commit 05e06f6 into opensistemas-hub:master Sep 14, 2018
@Peque
Copy link
Member

Peque commented Sep 14, 2018

@nicoddemus @RonnyPfannschmidt Thanks! 😍

@RonnyPfannschmidt
Copy link

RonnyPfannschmidt commented Sep 14, 2018

we are eager and happy to help people gravitate towards better testing, its been a pleasure 👍

@nicoddemus nicoddemus deleted the pytest-3.8-fix branch September 14, 2018 14:02
@codecov
Copy link

codecov bot commented Sep 19, 2018

Codecov Report

Merging #312 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #312      +/-   ##
==========================================
+ Coverage   99.25%   99.25%   +<.01%     
==========================================
  Files          26       26              
  Lines        3601     3602       +1     
  Branches      261      261              
==========================================
+ Hits         3574     3575       +1     
  Misses         15       15              
  Partials       12       12
Impacted Files Coverage Δ
osbrain/tests/test_agent_transport.py 96.42% <100%> (+0.04%) ⬆️

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 26ba98e...05e06f6. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants