Skip to content

Commit

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

## Version 4.3.0 (as yet unreleased)

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

This is a bugfix releases that fixes a regression issue.

### 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.add(py)
SKIPMODULES.add(pytest)
except ImportError:
pass

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

Expand Down

0 comments on commit eff4ca7

Please sign in to comment.