Skip to content

Commit

Permalink
Remove dependency of pyfakefs on pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbean-bremen committed Nov 2, 2020
1 parent 341c326 commit d299663
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ The released versions correspond to PyPi releases.

## Version 4.3.0 (as yet unreleased)

### Fixes
* remove dependency of pyfakefs on `pytest` (regression,
see [#565](../../issues/565))

## [Version 4.2.0](https://pypi.python.org/pypi/pyfakefs/4.2.0)

#### New Features
Expand Down
13 changes: 9 additions & 4 deletions pyfakefs/fake_filesystem_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@
import unittest
import warnings

import py
import pytest

from pyfakefs.deprecator import Deprecator
from pyfakefs.fake_filesystem import set_uid, set_gid, reset_ids, PatchMode
from pyfakefs.helpers import IS_PYPY
Expand Down Expand Up @@ -354,8 +351,16 @@ class Patcher:
'''
SKIPMODULES = {
None, fake_filesystem, fake_filesystem_shutil,
sys, linecache, tokenize, py, pytest
sys, linecache, tokenize
}
try:
import py
import pytest
SKIPMODULES += py
SKIPMODULES += pytest
except ImportError:
pass

assert None in SKIPMODULES, ("sys.modules contains 'None' values;"
" must skip them.")

Expand Down

0 comments on commit d299663

Please sign in to comment.