-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Problems when use latest version (4.1.0) #4613
Comments
this indicates a broken test which changes to a temporary folder which is subsequently deleted |
based on https://github.com/ezored/ezored/search?q=chdir&unscoped_q=chdir this seems to be entirely self inflicted as no cleanup seems to happen (at least based on the sample of examples i took a look at |
Its very strange, since no code was changed, only dependencies updated. Never had this problem. |
You say "latest version (2.6.1)", but the latest version is 4.1.0. Was that a typo? |
Sorry, pytest==4.1.0 and pytest-cov==2.6.1. |
Strange that this is only happening now, but @RonnyPfannschmidt's assessment is correct: your test functions change the current directory and this is making Search your test code for class TestDependency(TestCase):
@tempdir()
def test_dependency_list(self, d):
os.chdir(d.path)
d.write(Constants.PROJECT_FILE, Constants.PROJECT_FILE_DATA.encode('utf-8'))
... Becomes: class TestDependency(TestCase):
@tempdir()
def test_dependency_list(self, d, monkeypatch):
monkeypatch.chdir(d.path)
d.write(Constants.PROJECT_FILE, Constants.PROJECT_FILE_DATA.encode('utf-8'))
... I was thinking of creating a PR fixing this, but found that there are a ton of files with this pattern (24 files, 50 matches). 😋 |
@nicoddemus he cant use that due to unittest usage |
Oh right. Then he will need the "autouse trick" or a custom implementation. I will post those later. |
If you have any solution, can you post here? It don't happen on old commits: https://travis-ci.org/ezored/ezored/builds Very strange. |
Just a sidenote: please take a little more time with reporting, i.e. provide tracebacks as text etc. |
Two solutions:
Hope this helps |
Hi, I use the first solution and the problem was solved. Green again: Thanks. |
Hi,
After update my tool to latest pytest, i start getting this error:
https://travis-ci.org/ezored/ezored/jobs/476372726
Can anyone help me?
The text was updated successfully, but these errors were encountered: