opensistemas-hub / osbrain

osBrain - A general-purpose multi-agent system module written in Python
https://osbrain.readthedocs.io/en/stable/
Apache License 2.0
176 stars 43 forks source link

Fix compatibility with pytest 3.8.0 #312

Closed nicoddemus closed 6 years ago

nicoddemus commented 6 years ago

As discussed in https://github.com/pytest-dev/pytest/issues/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.

nicoddemus commented 6 years ago

Fair enough, thanks! Done

Peque commented 6 years ago

@nicoddemus @RonnyPfannschmidt Thanks! :heart_eyes:

RonnyPfannschmidt commented 6 years ago

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

codecov[bot] commented 6 years ago

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%) :arrow_up:

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.