import py
import pytest
from pyfakefs.fake_filesystem_unittest import Patcher

Patcher.SKIPMODULES.add(py)  # Ignore pytest components when faking filesystem


@pytest.fixture
def fs(request):
    """ Fake filesystem. """
    patcher = Patcher()
    patcher.setUp()
    request.addfinalizer(patcher.tearDown)
    return patcher.fs

import linecache

import py
import pytest
from pyfakefs.fake_filesystem_unittest import Patcher

Patcher.SKIPMODULES.add(py)  # Ignore pytest components when faking filesystem
Patcher.SKIPMODULES.add(linecache)  # Seems to be used by pytest internally


@pytest.fixture
def fs(request):
    """ Fake filesystem. """
    patcher = Patcher()
    patcher.setUp()
    request.addfinalizer(patcher.tearDown)
    return patcher.fs

Add linecache module to skipped modules for pytest plugin
Add linecache module to skipped modules for pytest plugin

- see #381
- fixes the problem under Python 3, but not under Python 2

+ import linecache
+ 
  import py
  import pytest
  from pyfakefs.fake_filesystem_unittest import Patcher
  
  Patcher.SKIPMODULES.add(py)  # Ignore pytest components when faking filesystem
+ Patcher.SKIPMODULES.add(linecache)  # Seems to be used by pytest internally
  
  
  @pytest.fixture
  def fs(request):
      """ Fake filesystem. """
      patcher = Patcher()
      patcher.setUp()
      request.addfinalizer(patcher.tearDown)
      return patcher.fs
  
Add linecache module to skipped modules for pytest plugin
## Code Before:
import py
import pytest
from pyfakefs.fake_filesystem_unittest import Patcher

Patcher.SKIPMODULES.add(py)  # Ignore pytest components when faking filesystem


@pytest.fixture
def fs(request):
    """ Fake filesystem. """
    patcher = Patcher()
    patcher.setUp()
    request.addfinalizer(patcher.tearDown)
    return patcher.fs

## Instruction:
Add linecache module to skipped modules for pytest plugin
## Code After:
import linecache

import py
import pytest
from pyfakefs.fake_filesystem_unittest import Patcher

Patcher.SKIPMODULES.add(py)  # Ignore pytest components when faking filesystem
Patcher.SKIPMODULES.add(linecache)  # Seems to be used by pytest internally


@pytest.fixture
def fs(request):
    """ Fake filesystem. """
    patcher = Patcher()
    patcher.setUp()
    request.addfinalizer(patcher.tearDown)
    return patcher.fs
