pytest-dev / pytest-dev/pytest

Windows and Cygwin __pycache__ entries conflict

Open
#2,278 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

platform: windows topic: rewrite
Dominant language
Python
Stars
14.5k
Forks
3.4k
Avg merge
2d 9h
Merged PRs (30d)
35

Description

If I want to check same version of windows and cygwin flavour of python one that's tested later always fail.
Removing of __pycache__ directories helps.
Error is like this:

# python -m pytest tests/test_cli.py
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/_pytest/config.py", line 362, in _importconftest
    mod = conftestpath.pyimport()
  File "/usr/lib/python2.7/site-packages/py/_path/local.py", line 680, in pyimport
    raise self.ImportMismatchError(modname, modfile, self)
ImportMismatchError: ('conftest', 'C:\\src\\project\\tests\\conftest.py', local('/src/github/project/tests/conftest.py'))
ERROR: could not load /src/project/tests/conftest.py

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with python -m pytest tests/test_cli.py using Windows and Cygwin Python environments, then inspect the reported tests/conftest.py import mismatch and __pycache__ behavior. Done means both environments can run the same test suite without one environment's cached entries causing the other to fail.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
operating-systems, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.